-
Notifications
You must be signed in to change notification settings - Fork 193
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
refactor!: proof_of_sql_parser::intermediate_ast::OrderBy
with sqlparser::ast::OrderByExpr
in the proof-of-sql crate
#450
base: main
Are you sure you want to change the base?
Conversation
fb9aa62
to
d7d1606
Compare
fn owned_column_to_expr<S: Scalar>(col: &OwnedColumn<S>) -> Expr { | ||
match col { | ||
OwnedColumn::Boolean(_) => Expr::Identifier("BooleanColumn".into()), | ||
OwnedColumn::TinyInt(_) => Expr::Identifier("TinyIntColumn".into()), | ||
OwnedColumn::SmallInt(_) => Expr::Identifier("SmallIntColumn".into()), | ||
OwnedColumn::Int(_) => Expr::Identifier("IntColumn".into()), | ||
OwnedColumn::BigInt(_) => Expr::Identifier("BigIntColumn".into()), | ||
OwnedColumn::VarChar(_) => Expr::Identifier("VarCharColumn".into()), | ||
OwnedColumn::Int128(_) => Expr::Identifier("Int128Column".into()), | ||
OwnedColumn::Decimal75(_, _, _) => Expr::Identifier("DecimalColumn".into()), | ||
OwnedColumn::Scalar(_) => Expr::Identifier("ScalarColumn".into()), | ||
OwnedColumn::TimestampTZ(_, _, _) => Expr::Identifier("TimestampColumn".into()), | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm this leads to duplicates, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ha ve implemented it for bidirectional as some places needed it. i will debug and fix if we doesn't needed it
( | ||
col.clone(), | ||
OrderByExpr { | ||
expr: owned_column_to_expr(col), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK we can't do this since expressions are not by default identifiers.
)) | ||
|order_by| -> PostprocessingResult<(OwnedColumn<S>, OrderByExpr)> { | ||
let identifier = match &order_by.expr { | ||
Expr::Identifier(ident) => ident.clone(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can order by expressions such as c0 + c1, not identifiers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If expressions are needed I think we need some rework here and I will revisit later here once all the open PRs are get merged
4775126
to
bf47e4d
Compare
…parser::ast::OrderByExpr` in the proof-of-sql crate
bf47e4d
to
981cf73
Compare
Please be sure to look over the pull request guidelines here: https://github.com/spaceandtimelabs/sxt-proof-of-sql/blob/main/CONTRIBUTING.md#submit-pr.
Please go through the following checklist
!
is used if and only if at least one breaking change has been introduced.source scripts/run_ci_checks.sh
.Rationale for this change
This PR addresses the need to replace the
proof_of_sql_parser::OrderBy
with thesqlparser::ast::OrderByExpr
in theproof-of-sql
crate as part of a larger transition toward integrating thesqlparser
.This change is a subtask of issue #235, with the main goal of streamlining the repository by switching to the
sqlparser
crate and gradually replacing intermediary constructs likeproof_of_sql_parser::intermediate_ast
withsqlparser::ast
.What changes are included in this PR?
proof_of_sql_parser::OrderBy
have been replaced withsqlparser::ast::OrderByExpr
OrderBy
has been updated to maintain the original functionality, ensuring no changes to the logic or behavior.Are these changes tested?
Yes
Part of #235