Oscar Morante created DRILL-4341: ------------------------------------ Summary: Fails to parse string literals containing escaped quotes Key: DRILL-4341 URL: https://issues.apache.org/jira/browse/DRILL-4341 Project: Apache Drill Issue Type: Bug Affects Versions: 1.5.0 Reporter: Oscar Morante
In some situations, Drill fails to parse strings with escaped single quotes. Just changing the last line of this query makes the problem appear and disappear (without touching the string it's complaining about): {code:sql} select 'yyyy-MM-dd''T''HH:mm:ss.SSS''Z''' from s3; --> FAILS --s3.`2015`; --> FAILS --s3.`2015/11`; --> FAILS --s3.`2015/11/3`; --> WORKS --s3.`2015/11/3/10-1072045-1612661.json.gz`; --> WORKS --(select * from s3 limit 1); --> WORKS --(select * from s3.`2015` limit 1); --> WORKS --(select * from s3.`2015/11` limit 1); --> WORKS {code} This is the error when it fails: {code} ExampleExceptionFormatter: exception message was: SYSTEM ERROR: ExpressionParsingException: Expression has syntax error! line 1:12:missing EOF at 'T' Fragment 1:1 {code} This is very important when dealing with json files containing dates encoded as iso-8601 strings. My current workaround is something like this: {code:sql} select to_timestamp(regexp_replace(`timestamp`, '[TZ]', ''), 'yyyy-MM-ddHH:mm:ss.SSS') from s3; {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)