You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Vitalii Diravka <vi...@gmail.com> on 2016/06/27 13:43:15 UTC

Non-reserved words on the first place of a sql statement

Hi all!

Recently I tried to use "ADD" on the first place of a new custom sql
statement and found that non-reserved words can't be placed on the first
place of the statement.
But it is ok if a non-reserved word is placed on the other places of a
statement.

Can anybody explain me the reason of this parser behavior?

Thanks!

Kind regards
Vitalii

Re: Non-reserved words on the first place of a sql statement

Posted by Vitalii Diravka <vi...@gmail.com>.
Thanks for reply.

I will seek some workaround of this to solve the task.


Kind regards
Vitalii

2016-06-27 13:54 GMT+00:00 Atri Sharma <at...@gmail.com>:

> On 27 Jun 2016 7:13 pm, "Vitalii Diravka" <vi...@gmail.com>
> wrote:
> >
> > Hi all!
> >
> > Recently I tried to use "ADD" on the first place of a new custom sql
> > statement and found that non-reserved words can't be placed on the first
> > place of the statement.
> > But it is ok if a non-reserved word is placed on the other places of a
> > statement.
> >
> > Can anybody explain me the reason of this parser behavior?
> >
> Reserved tokens help define the starting state of the parser. If non
> reserved keywords were allowed as the first token, there would be ambiguity
> as to which rule to apply.
>

Re: Non-reserved words on the first place of a sql statement

Posted by Atri Sharma <at...@gmail.com>.
On 27 Jun 2016 7:13 pm, "Vitalii Diravka" <vi...@gmail.com> wrote:
>
> Hi all!
>
> Recently I tried to use "ADD" on the first place of a new custom sql
> statement and found that non-reserved words can't be placed on the first
> place of the statement.
> But it is ok if a non-reserved word is placed on the other places of a
> statement.
>
> Can anybody explain me the reason of this parser behavior?
>
Reserved tokens help define the starting state of the parser. If non
reserved keywords were allowed as the first token, there would be ambiguity
as to which rule to apply.