I bet that the SqlIdentifier for the first item in the SELECT clause
has one component, and that component is quoted:

  SqlIdentifier id;
  id.isComponentQuoted(0); // evaluates true

The name of the component will be "sql" (without back-ticks).

The second item will also have one component, not quoted, whose name
is "id1" or "ID1" (depending on whether the parser is configured to
convert unquoted identifiers to upper-case).

Julian


On Sat, Dec 14, 2019 at 2:11 AM Muhammad Gelbana <mgelb...@apache.org> wrote:
>
> I don't find it correct to have quotes, double-quotes, backticks or
> anything other than the identifier name in the SqlNode's identifier. If you
> need it, you can just add it your self.
>
> But why do you want to have the identifier this way ? May be there is
> another way to achieve your goal ?
>
>
> On Sat, Dec 14, 2019 at 4:03 AM 月宫的木马兔 <groobym...@qq.com> wrote:
>
> > Hi,
> >
> > I got the SqlNode  by using SqlParse.parseQuery() (Sql bellow),  but I can 
> > not find the back_tick in SqlIdentifer
> >
> > Sql:
> >
> > SELECT `sql`,id1 FROM testdata
> >
> > Debug with IDEA:
> >
> >
> >

Reply via email to