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

Francesco Palmiotto commented on KYLIN-1090:
--------------------------------------------

Already tried that with no luck.

If I use single quotes: 

Encountered ". \'year\'" at line 1, column 9. Was expecting one of: "FROM" ... 
"," ... "AS" ... <IDENTIFIER> ... <QUOTED_IDENTIFIER> ... 
<BACK_QUOTED_IDENTIFIER> ... <BRACKET_QUOTED_IDENTIFIER> ... 
<UNICODE_QUOTED_IDENTIFIER> ... "." ... "NOT" ... "IN" ... "BETWEEN" ... "LIKE" 
... "SIMILAR" ... "=" ... ">" ... "<" ... "<=" ... ">=" ... "<>" ... "+" ... 
"-" ... "*" ... "/" ... "||" ... "AND" ... "OR" ... "IS" ... "MEMBER" ... 
"SUBMULTISET" ... "MULTISET" ... "[" ... "." <IDENTIFIER> ... "." 
<QUOTED_IDENTIFIER> ... "." <BACK_QUOTED_IDENTIFIER> ... "." 
<BRACKET_QUOTED_IDENTIFIER> ... "." <UNICODE_QUOTED_IDENTIFIER> ... "." "*" ... 
"(" ...


If I use double quotes:

>From line 3, column 12 to line 3, column 17: Column 'year' not found in table 
>'F

> Cannot query a column whose name is one of the following: year, month, day, 
> hour, minute, second
> ------------------------------------------------------------------------------------------------
>
>                 Key: KYLIN-1090
>                 URL: https://issues.apache.org/jira/browse/KYLIN-1090
>             Project: Kylin
>          Issue Type: Bug
>          Components: Query Engine
>    Affects Versions: v1.1
>            Reporter: Francesco Palmiotto
>            Assignee: liyang
>
> Suppose we have a query like:
> "select f.year, avg(f.my_measure)
> from fact_table f
> group by f.year"
> This will fail and throw the following error:
> Encountered ". year" at line 1, column 9. Was expecting one of: "FROM" ... 
> "," ... "AS" ... <IDENTIFIER> ... <QUOTED_IDENTIFIER> ... 
> <BACK_QUOTED_IDENTIFIER> ... <BRACKET_QUOTED_IDENTIFIER> ... 
> <UNICODE_QUOTED_IDENTIFIER> ... "." ... "NOT" ... "IN" ... "BETWEEN" ... 
> "LIKE" ... "SIMILAR" ... "=" ... ">" ... "<" ... "<=" ... ">=" ... "<>" ... 
> "+" ... "-" ... "*" ... "/" ... "||" ... "AND" ... "OR" ... "IS" ... "MEMBER" 
> ... "SUBMULTISET" ... "MULTISET" ... "[" ... "." <IDENTIFIER> ... "." 
> <QUOTED_IDENTIFIER> ... "." <BACK_QUOTED_IDENTIFIER> ... "." 
> <BRACKET_QUOTED_IDENTIFIER> ... "." <UNICODE_QUOTED_IDENTIFIER> ... "." "*" 
> ... "(" ...
> I think this is due to the fact that year, month, day, hour, minute and 
> second are all reserved keywords in ANSI SQL.



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

Reply via email to