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

Eric Lomore commented on PHOENIX-3265:
--------------------------------------

I tried a few things.

Fixing this for create table/view is very simple as that's handled by 
Phoenix/Calcite grammar and pings the NonReserveredKeyWord() method. 
https://issues.apache.org/jira/browse/CALCITE-1241
Making use of this, I got this working:
{{CREATE TABLE t (k1 VARCHAR, DATE VARCHAR, CONSTRAINT pk PRIMARY KEY (k1 DESC, 
k2))}}

For the WHERE, GROUP BY, ON, etc. this is handled deep in the Calcite grammar, 
and it does not hit the same function.  There's not much of a way to change 
this, unless we want phoenix to handle more of the grammar processing, but it 
would be extensive to say the least.
While adding quotes around DATE does fix the problem, doing so would seemingly 
have to be on the input side (the test cases). As I've seen so far, we always 
try to avoid this.

Happy to hear your thoughts on this. Thanks [~jamestaylor]

> Surround columns named date with double quotes
> ----------------------------------------------
>
>                 Key: PHOENIX-3265
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3265
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: James Taylor
>            Assignee: Eric Lomore
>
> In Phoenix {{date}} is not a reserved word, but perhaps in Calcite it is? If 
> that's the case, we should surround occurrences of columns named {{date}} in 
> double quotes to prevent the parser error.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to