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

Vladimir Sitnikov edited comment on CALCITE-2479 at 8/19/18 5:10 PM:
---------------------------------------------------------------------

My bad: it turns out {{select s.count ...}} does not work, and it requires 
{{count}} to be quoted.

Then advisor should automatically quote identifiers that look like keywords.


was (Author: vladimirsitnikov):
My bad: it turns out {{select s.count ... }} does not work, and it requires 
{{count}} to be quoted.

Then advisor should automatically quote identifiers that look like keywords.

> SqlAdvisor: lack of hints for select s.count SQL
> ------------------------------------------------
>
>                 Key: CALCITE-2479
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2479
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.17.0
>            Reporter: Vladimir Sitnikov
>            Assignee: Julian Hyde
>            Priority: Major
>
> Case for SqlAdvisorTest:
> {code:java}  @Ignore("It looks like s.count clashes with COUNT keyword, 
> however the same SQL executes just fine")
>   @Test @WithLex(Lex.JAVA) public void testAdviceExpression() {
>     String sql;
>     sql = "select s.count+s.co^ from (select 1 count from emp) s";
>     assertComplete(sql, "COLUMN(count)\n", "co",
>         ImmutableMap.of("COLUMN(count)", "count"));
>   }
> {code}
> It is not clear why SQL fails to advise, however the same query works just 
> fine via JDBC.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to