Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[V1] Remove PartiQLValue from the AST #1589

Open
RCHowell opened this issue Sep 20, 2024 · 0 comments
Open

[V1] Remove PartiQLValue from the AST #1589

RCHowell opened this issue Sep 20, 2024 · 0 comments
Labels
V1 This is related to the V1 release of PartiQL.

Comments

@RCHowell
Copy link
Member

Some AST cleanup work,

  • The AST should have its own representation of values independent of PartiQLValue (to be deprecated) and Datum.
  • Similarly, the AST should not necessarily be dependent on partiql-types/partiql-spi packages (but ok if more practical).

To the first point, notice how AST types are independent of PType as there are many syntaxes for a single type e.g. BOOL|BOOLEAN.

This PR would require defining AST expr literal variants for the parser rules

literal
    : NULL                                                                                # LiteralNull
    | MISSING                                                                             # LiteralMissing
    | TRUE                                                                                # LiteralTrue
    | FALSE                                                                               # LiteralFalse
    | LITERAL_STRING                                                                      # LiteralString
    | LITERAL_INTEGER                                                                     # LiteralInteger
    | LITERAL_DECIMAL                                                                     # LiteralDecimal
    | ION_CLOSURE                                                                         # LiteralIon
    | DATE LITERAL_STRING                                                                 # LiteralDate
    | TIME ( PAREN_LEFT LITERAL_INTEGER PAREN_RIGHT )? (WITH TIME ZONE)? LITERAL_STRING   # LiteralTime
    | TIMESTAMP ( PAREN_LEFT LITERAL_INTEGER PAREN_RIGHT )? (WITH TIME ZONE)? LITERAL_STRING   # LiteralTimestamp
    ;

Along with updating the pretty-printer in org.partiql.ast.sql

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
V1 This is related to the V1 release of PartiQL.
Projects
None yet
Development

No branches or pull requests

1 participant