You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@impala.apache.org by Zoltan Ivanfi <zi...@cloudera.com> on 2016/09/21 19:03:47 UTC

Purpose of ParseNode.toSql()

Dear Impala Developers,

I looked into IMPALA-784, which is about properly quoting the result of a
"show create table" command. I noticed the ToSqlTest which checks that
ParseNode.toSql() applies proper quoting. However, I found that the handler
of the "show create table" statement does not use ParseNode.toSql() at all
(presumably because the ParseNode object for the "create table" statement
ceases to exist once the statement is executed). This however leaves me
wondering: What is ParseNode.toSql() actually used for beside being tested?

Thanks,

Zoltan

Re: Purpose of ParseNode.toSql()

Posted by Alex Behm <al...@cloudera.com>.
The main purpose of toSql() is for creating views and the "show create
table" statement.

Note that when creating a view it is not correct to just dump the query
text as is into the Hive Metastore because table names need to be resolved
and fully qualified when storing the view definition.

On Wed, Sep 21, 2016 at 12:03 PM, Zoltan Ivanfi <zi...@cloudera.com> wrote:

> Dear Impala Developers,
>
> I looked into IMPALA-784, which is about properly quoting the result of a
> "show create table" command. I noticed the ToSqlTest which checks that
> ParseNode.toSql() applies proper quoting. However, I found that the handler
> of the "show create table" statement does not use ParseNode.toSql() at all
> (presumably because the ParseNode object for the "create table" statement
> ceases to exist once the statement is executed). This however leaves me
> wondering: What is ParseNode.toSql() actually used for beside being tested?
>
> Thanks,
>
> Zoltan
>