You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Laksh Singla <la...@imply.io> on 2022/01/21 04:23:56 UTC

Parsing multiple SQL statements using Calcite

Hi,

I was wondering if there's a way to parse multiple SQL statements in
Calcite. In the reference grammar, there is a "statementList" production
rule which allows for parsing multiple statements. However, in the
Calcite's code, I didn't find any usage of the method "SqlNodeList
parseStmtList" which seems to utilize the production rule. I do see that
the method is public, so is there another way to utilize it (apart from
directly calling `planner.parse(sqlString)`.

Thanks and Regards
Laksh

Re: Parsing multiple SQL statements using Calcite

Posted by Laksh Singla <la...@imply.io>.
Thanks Julian for clearing up the doubt.

Regards
Laksh

On Sat, Jan 22, 2022 at 12:48 AM Julian Hyde <jh...@gmail.com> wrote:

> You are right. We support parsing multiple statements [1] but we don’t
> support multi-statement validation, multi-statement planning or
> multi-statement execution.
>
> Julian
>
>
> [1] https://issues.apache.org/jira/browse/CALCITE-2453 <
> https://issues.apache.org/jira/browse/CALCITE-2453>.
>
>
> > On Jan 20, 2022, at 8:23 PM, Laksh Singla <la...@imply.io> wrote:
> >
> > Hi,
> >
> > I was wondering if there's a way to parse multiple SQL statements in
> > Calcite. In the reference grammar, there is a "statementList" production
> > rule which allows for parsing multiple statements. However, in the
> > Calcite's code, I didn't find any usage of the method "SqlNodeList
> > parseStmtList" which seems to utilize the production rule. I do see that
> > the method is public, so is there another way to utilize it (apart from
> > directly calling `planner.parse(sqlString)`.
> >
> > Thanks and Regards
> > Laksh
>
>

Re: Parsing multiple SQL statements using Calcite

Posted by Julian Hyde <jh...@gmail.com>.
You are right. We support parsing multiple statements [1] but we don’t support multi-statement validation, multi-statement planning or multi-statement execution.

Julian


[1] https://issues.apache.org/jira/browse/CALCITE-2453 <https://issues.apache.org/jira/browse/CALCITE-2453>.


> On Jan 20, 2022, at 8:23 PM, Laksh Singla <la...@imply.io> wrote:
> 
> Hi,
> 
> I was wondering if there's a way to parse multiple SQL statements in
> Calcite. In the reference grammar, there is a "statementList" production
> rule which allows for parsing multiple statements. However, in the
> Calcite's code, I didn't find any usage of the method "SqlNodeList
> parseStmtList" which seems to utilize the production rule. I do see that
> the method is public, so is there another way to utilize it (apart from
> directly calling `planner.parse(sqlString)`.
> 
> Thanks and Regards
> Laksh