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

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

I have been able to replicate this issue using the supplied template. Of note, 
when I change the "Cache Schema" to "true" it processes properly. Only when 
Cache Schema is false does it fail. When Cache Schema is true, we use a Calcite 
Prepared Statement. But when it is false, we use a regular Statement object and 
call execute(String sql). So this appears to me to be a bug in Calcite. Will 
dig a bit more.

> 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