You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Dmitry Sysolyatin (Jira)" <ji...@apache.org> on 2023/04/10 11:49:00 UTC

[jira] [Commented] (CALCITE-5403) Babel parser should parse PostgreSQL's SET, RESET, BEGIN, SHOW, ROLLBACK, COMMIT commands

    [ https://issues.apache.org/jira/browse/CALCITE-5403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17710119#comment-17710119 ] 

Dmitry Sysolyatin commented on CALCITE-5403:
--------------------------------------------

[~julianhyde] Regarding:
{code}
Having a subclass of SqlSpecialOperator for every kind of Ast node is a pattern that we need to stop doing. Can you find a way to do this using SqlBasicOperator or similar?
{code}

Can you elaborate this statement ? Even if replace SqlSpecialOperator by SqlBasicOperator, subclass is still needed because createCall method should be overwritten in order to return correct instance of SqlCall.
For instance:
{code}
SqlBegin.OPERATOR.createCall should return instance of SqlBegin
{code}

> Babel parser should parse PostgreSQL's SET, RESET, BEGIN, SHOW, ROLLBACK, COMMIT commands
> -----------------------------------------------------------------------------------------
>
>                 Key: CALCITE-5403
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5403
>             Project: Calcite
>          Issue Type: Bug
>          Components: babel
>    Affects Versions: 1.34.0
>            Reporter: Dmitry Sysolyatin
>            Assignee: Dmitry Sysolyatin
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.35.0
>
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> Babel parser can not parse BEGIN [1], SHOW [2], ROLLBACK [3], COMMIT [4] commands at the moment.
> It can parse SET [5] and RESET [6], but not completely. For instance, it can not parse the following statement:
> {code:java}
> SET SCHEMA public,public,"$user"
> {code}
> The syntax for these commands is as follows:
>  * BEGIN [1]:
> {code:java}
> BEGIN [ WORK | TRANSACTION ] [ transaction_mode [, ...] ] 
> where transaction_mode is one of: ISOLATION LEVEL { SERIALIZABLE | REPEATABLE READ | READ COMMITTED | READ UNCOMMITTED } READ WRITE | READ ONLY [ NOT ] DEFERRABLE
> {code}
>  * SHOW [2]:
> {code:java}
> SHOW (<TRANSACTION ISOLATION LEVEL> | <string literal>)
> {code}
>  * ROLLBACK [3]:
> {code:java}
> ROLLBACK [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]
> {code}
>  * COMMIT [4]:
> {code:java}
> COMMIT [ WORK | TRANSACTION ] [ AND [ NO ] CHAIN ]
> {code}
>  * SET [5]
> {code:java}
> SET [ SESSION | LOCAL ] configuration_parameter { TO | = } { value | 'value' | DEFAULT }
> SET [ SESSION | LOCAL ] TIME ZONE { value | 'value' | LOCAL | DEFAULT }
> SET [ SESSION | LOCAL ]  { SCHEMA | SEED | NAMES } value
> Values can be specified as string constants, identifiers, numbers, or comma-separated lists of these
> {code}
>  * RESET [6]
> {code:java}
> RESET <parameter>;
> {code}
> [1] [https://www.postgresql.org/docs/current/sql-begin.html]
> [2] [https://www.postgresql.org/docs/current/sql-show.html]
> [3] [https://www.postgresql.org/docs/current/sql-rollback.html]
> [4] [https://www.postgresql.org/docs/current/sql-commit.html]
> [5] [https://www.postgresql.org/docs/current/sql-set.html]
> [6] [https://www.postgresql.org/docs/current/sql-reset.html]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)