[ 
https://issues.apache.org/jira/browse/NIFI-4047?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16044474#comment-16044474
 ] 

Mark Payne commented on NIFI-4047:
----------------------------------

Looking at this closer, I found that we were actually using the wrong Lexical 
policy when not caching (originally, it was using the JAVA Lexical Policy, then 
it was changed to MYSQL_ANSI Lexical Policy but when we changed it, it was 
changed only for the branch of code that uses cached schemas). The attached PR 
changes the lexical policy to use MYSQL_ANSI in both cases.

> QueryRecord hits a run time exception when using double quotes 
> ---------------------------------------------------------------
>
>                 Key: NIFI-4047
>                 URL: https://issues.apache.org/jira/browse/NIFI-4047
>             Project: Apache NiFi
>          Issue Type: Bug
>            Reporter: Joseph Percivall
>         Attachments: NIFI-4047.xml
>
>
> To reproduce:
> Attempt to run the below query. "first" is a reserved word so it needs to be 
> surrounded it in quotes. 
> SELECT "first" AS first_seen
> FROM FLOWFILE
> In doing so, the processor successfully validates and is ready to run. When 
> run, it hits the following RunTimeException:
> 16:16:31 EDT ERROR 82ec3eda-015c-1000-5f5e-3dbf6d4b3145
> QueryRecord[id=82ec3eda-015c-1000-5f5e-3dbf6d4b3145] Unable to query 
> StandardFlowFileRecord[uuid=cd8d94cb-96b4-4daf-96a5-454d4d4640d9,claim=StandardContentClaim
>  [resourceClaim=StandardResourceClaim[id=1496946569360-1, container=default, 
> section=1], offset=6721, length=167],offset=0,name=22416107244401,size=167] 
> due to java.lang.RuntimeException: parse failed: Encountered "\"" at line 1, 
> column 8.
> Was expecting one of:
>     "UNION" ...
>     "INTERSECT" ...
> (where it continues to list all the expected values)
> I think the double quote is somehow getting mis-translated when being parsed 
> by the Calcite backend.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to