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] Port SqlDialect to v1 AST #1638

Merged
merged 2 commits into from
Nov 4, 2024
Merged

[v1] Port SqlDialect to v1 AST #1638

merged 2 commits into from
Nov 4, 2024

Conversation

alancai98
Copy link
Member

@alancai98 alancai98 commented Nov 2, 2024

Relevant Issues

Description

  • Ports SqlDialect to the v1 AST
  • Adds DataType to visitor methods
  • Some small bug fixes
    • Rename of some factory methods args for consistency

Other Information

  • Updated Unreleased Section in CHANGELOG: [NO]

    • No on v1
  • Any backward-incompatible changes? [YES]

    • Yes but on v1
  • Any new external dependencies? [NO]

  • Do your changes comply with the Contributing Guidelines
    and Code Style Guidelines? [YES]

License Information

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@alancai98 alancai98 self-assigned this Nov 2, 2024
Copy link

github-actions bot commented Nov 2, 2024

CROSS-ENGINE-REPORT ❌

BASE (LEGACY-V0.14.8) TARGET (EVAL-507F4D3) +/-
% Passing 89.67% 94.39% 4.72% ✅
Passing 5287 5565 278 ✅
Failing 609 50 -559 ✅
Ignored 0 281 281 🔶
Total Tests 5896 5896 0 ✅

Testing Details

  • Base Commit: v0.14.8
  • Base Engine: LEGACY
  • Target Commit: 507f4d3
  • Target Engine: EVAL

Result Details

  • ❌ REGRESSION DETECTED. See Now Failing/Ignored Tests. ❌
  • Passing in both: 2643
  • Failing in both: 17
  • Ignored in both: 0
  • PASSING in BASE but now FAILING in TARGET: 3
  • PASSING in BASE but now IGNORED in TARGET: 108
  • FAILING in BASE but now PASSING in TARGET: 180
  • IGNORED in BASE but now PASSING in TARGET: 0

Now FAILING Tests ❌

The following 3 test(s) were previously PASSING in BASE but are now FAILING in TARGET:

Click here to see
  1. undefinedUnqualifiedVariableWithUndefinedVariableBehaviorMissing, compileOption: PERMISSIVE
  2. undefinedUnqualifiedVariableIsNullExprWithUndefinedVariableBehaviorMissing, compileOption: PERMISSIVE
  3. undefinedUnqualifiedVariableIsMissingExprWithUndefinedVariableBehaviorMissing, compileOption: PERMISSIVE

Now IGNORED Tests ❌

The complete list can be found in GitHub CI summary, either from Step Summary or in the Artifact.

Now Passing Tests

180 test(s) were previously failing in BASE (LEGACY-V0.14.8) but now pass in TARGET (EVAL-507F4D3). Before merging, confirm they are intended to pass.

The complete list can be found in GitHub CI summary, either from Step Summary or in the Artifact.

CROSS-COMMIT-REPORT ✅

BASE (EVAL-D561ECE) TARGET (EVAL-507F4D3) +/-
% Passing 94.39% 94.39% 0.00% ✅
Passing 5565 5565 0 ✅
Failing 50 50 0 ✅
Ignored 281 281 0 ✅
Total Tests 5896 5896 0 ✅

Testing Details

  • Base Commit: d561ece
  • Base Engine: EVAL
  • Target Commit: 507f4d3
  • Target Engine: EVAL

Result Details

  • Passing in both: 5565
  • Failing in both: 50
  • Ignored in both: 281
  • PASSING in BASE but now FAILING in TARGET: 0
  • PASSING in BASE but now IGNORED in TARGET: 0
  • FAILING in BASE but now PASSING in TARGET: 0
  • IGNORED in BASE but now PASSING in TARGET: 0

*/
@lombok.Builder(builderClassName = "Builder")
@EqualsAndHashCode(callSuper = false)
public class ExprRowValue extends Expr {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(self-review): slight adjustment to RowValue modeling to be more consistent with what SQL99 defines -- https://ronsavage.github.io/SQL/sql-99.bnf.html#row%20value%20constructor. In the future, can consider also adding the optional ROW keyword.

@@ -12,14 +12,15 @@

/**
* TODO docs, equals, hashcode
* Also may not be an [Expr]?
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(self-review): at some point before v1, need to take a closer look at the VALUES modeling. I'm not sure yet if it should be an Expr or something different.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Subqueries generally need to be properly supported. #1641

Comment on lines +344 to +346
// Special case -- DATE_ADD('<datetime_field>', <lhs>, <rhs>) -> DATE_ADD(<datetime_field>, <lhs>, <rhs>)
// Special case -- DATE_DIFF('<datetime_field>', <lhs>, <rhs>) -> DATE_DIFF(<datetime_field>, <lhs>, <rhs>)
// TODO this will need to be rewritten once PartiQLValue is removed from AST
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(self-review) special conversion for DATE_ADD and DATE_DIFF since in the v1 AST, we model them as ExprCalls rather than dedicated nodes.

)
)
),
// SEXP not in v1
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(self-review) the SEXP constructor was removed in the v1 AST. IIRC, these were the only tests I commented out from SqlDialect.

@alancai98 alancai98 changed the title [v1][wip] Port SqlDialect to v1 AST [v1] Port SqlDialect to v1 AST Nov 4, 2024
@alancai98 alancai98 marked this pull request as ready for review November 4, 2024 22:33
@@ -12,14 +12,15 @@

/**
* TODO docs, equals, hashcode
* Also may not be an [Expr]?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Subqueries generally need to be properly supported. #1641

@alancai98 alancai98 merged commit ff87a2a into v1 Nov 4, 2024
12 checks passed
@alancai98 alancai98 deleted the v1-migrate-ast-sqldialect branch November 4, 2024 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants