I did supply is DDL parser factory but it's able to parse other DDL statements
such as DELETE, UPDATE, INSERT but not ALTER.
Sample code as below-
SqlParser.Config config = SqlParser.config()
.withParserFactory(SqlDdlParserImpl.FACTORY)
.withConformance(SqlConformanceEnum.STRICT_2003);
SqlParser parser = SqlParser.create("alter table tab1 drop column col1",
config);
SqlNode node = parser.parse();
________________________________
From: Jacques Nadeau <[email protected]>
Sent: Thursday, January 6, 2022 11:19 PM
To: [email protected] <[email protected]>
Subject: Re: Parsing ALTER TABLE Statements
I believe this is a feature that is off by default. Try creating your
parser with an alternative parser factory. I think it is something like
this:
SqlParser.Config.DEFAULT.withParserFactory(SqlDdlParserImpl.FACTORY)
On Thu, Jan 6, 2022 at 6:10 AM Yogendra Sharma <[email protected]> wrote:
> Wondering why does calcite DDL parser fail to parse ALTER TABLE stayements?
>
> In the code I see that we support ALTER SESSION and ALTER SYSTEM but not
> ALTER Table.
>
> -Yogi
>
>
>
> Get Outlook for Android<https://aka.ms/ghei36>
>