partiql / partiql-lang-kotlin

PartiQL libraries and tools in Kotlin.
https://partiql.org/
Apache License 2.0
538 stars 60 forks source link

[v1] Remove unsupported nodes from the AST #1477

Closed alancai98 closed 2 weeks ago

alancai98 commented 4 months ago

Currently the v1 AST (https://github.com/partiql/partiql-lang-kotlin/blob/22bb46125b4f2271d0e4ad6e206e76cc0ac25175/partiql-ast/src/main/resources/partiql_ast.ion) supports some nodes that are not in SQL99/SQL++ and do not intend to be part of the v1 release. E.g.

This issue tracks the removal of such nodes.

alancai98 commented 2 months ago

Also should look at set_op defined within the s_f_w node of Ast's Expr: https://github.com/partiql/partiql-lang-kotlin/blob/5b86afc7a3e1a98d379645b709de03caf6436695/partiql-ast/src/main/resources/partiql_ast.ion#L544-L547

It seems redundant with bag_op: https://github.com/partiql/partiql-lang-kotlin/blob/5b86afc7a3e1a98d379645b709de03caf6436695/partiql-ast/src/main/resources/partiql_ast.ion#L527-L533

Currently, the default partiql-parser also creates bag_op rather than set_op: https://github.com/partiql/partiql-lang-kotlin/blob/5b86afc7a3e1a98d379645b709de03caf6436695/partiql-parser/src/main/kotlin/org/partiql/parser/internal/PartiQLParserDefault.kt#L1221-L1258

and setOp within Expr.SFW is always set to null: https://github.com/partiql/partiql-lang-kotlin/blob/5b86afc7a3e1a98d379645b709de03caf6436695/partiql-parser/src/main/kotlin/org/partiql/parser/internal/PartiQLParserDefault.kt#L1034-L1038