title: AWS Athena table creation fails with “no viable alternative at input 'create external'”
body: <p>This is my first attempt with Athena, please be gentle :)</p>
  
  <p>This query is not failing with error -> No viable alternative</p>
  
  <pre><code>    CREATE EXTERNAL TABLE IF NOT EXISTS dev.mytokendata (
               'dateandtime' timestamp, 'requestid' string, 
   'ip' string, 'caller' string, 'token' string, 'requesttime' int, 
   'httpmethod' string, 'resourcepath' string, 'status' smallint, 
   'protocol' string, 'responselength' int ) 
      ROW FORMAT SERDE 'com.amazonaws.glue.serde.GrokSerDe'
      WITH SERDEPROPERTIES ( 
      'input.format'='%{TIMESTAMP_ISO8601:dateandtime}
        \s+\{\"requestId\":\s+\"%{USERNAME:requestid}\",
        \s+\"ip\":\s+\"%{IP:ip}\",
        \s+\"caller\":\s+\"%{USERNAME:caller}\",
        \s+\"token\":\s+\"%{USERNAME:token}\",
        \s+\"requestTime\":\s+\"%{INT:requesttime}\",
        \s+\"httpMethod\":\s+\"%{WORD:httpmethod}\",
        \s+\"resourcePath\":\s+\"%{UNIXPATH:resourcepath}\",
        \s+\"status\":\s+\"%{INT:status}\",
        \s+\"protocol\":\s+\"%{UNIXPATH:protocol}\",
        \s+\"responseLength:\"\s+\"%{INT:responselength}\"\s+\}' ) 
  STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat' 
  OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' 
  LOCATION 's3://athena-abc/1234/' 
  TBLPROPERTIES ('has_encrypted_data'='false', 'compressionType'='gzip');
  </code></pre>
  
  <p>This is a line from the log file which I am trying to parse (.gz file)</p>
  
  <pre><code>2018-07-30T02:23:34.134Z { "requestId":
  "810000-9100-1100-a100-f100000", "ip": "01.01.01.001", "caller": "-", 
  "token": "1234-5678-78910-abcd", "requestTime": 
   "1002917414000", "httpMethod": "POST", "resourcePath": 
   "/MyApp/v1.0/MyService.wsdl", 
   "status": "200", "protocol": "HTTP/1.1", "responseLength": "1000" }
  </code></pre>
  
  <p>Can anyone please point out what may be wrong? It would be of great help</p>