sxt-proof-of-sql icon indicating copy to clipboard operation
sxt-proof-of-sql copied to clipboard

Replace `proof_of_sql_parser::intermediate_ast::Literal` and `proof_of_sql_parser::intermediate_ast::Expression` with `sqlparser::ast::Expr` in the `proof-of-sql` crate

Open iajoiner opened this issue 3 months ago • 0 comments

Background and Motivation

This issue is a subtask in https://github.com/spaceandtimelabs/sxt-proof-of-sql/issues/235. In short since we plan to add more SQL features we plan to switch to the sqlparser crate which is a feature-rich, no_std-compatible parser used by DataFusion, which is part of the Arrow ecosystem.

Right now we already have some code that can convert intermediate AST from proof-of-sql-parser we use to sqlparser AST. Now we need to systematically replace instances of proof-of-sql-parser constructs with their corresponding sqlparser ones.

Changes Required

  • [ ] Replace proof_of_sql_parser::intermediate_ast::Literal with sqlparser::ast::Expr in the proof-of-sql crate.
  • [ ] Replace proof_of_sql_parser::intermediate_ast::Expression with sqlparser::ast::Expr in the proof-of-sql crate.

Notes:

  • This issue is blocked until the following issues are complete:
    • #348
    • #349
    • #350
    • #351
    • #352
  • The reason why we want to cast Literal to Expr as opposed to Value is that Value doesn't handle timestamp type. If you have a clever solution that can use Value instead of Literal it is even better but using Expr is what we currently expect.

iajoiner avatar Nov 07 '24 19:11 iajoiner