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

Partiql eval limit offset #1371

Merged
merged 1 commit into from
Feb 20, 2024
Merged

Partiql eval limit offset #1371

merged 1 commit into from
Feb 20, 2024

Conversation

yliuuuu
Copy link
Contributor

@yliuuuu yliuuuu commented Feb 14, 2024

Relevant Issues

  • [Closes/Related To] Issue #XXX

Description

  • Remodel Limit / Offset

If limit is 0 or null, the query should behavior as the same as if there were no limit clause.
If offset is 0 or null, the query should behavior as the same as if there were no offset clause.
If limit and offset clause both exist, the offset should get executed first.

Update:
When converting from AST to Plan, append the offset node first then the limit node.

Other Information

  • Updated Unreleased Section in CHANGELOG: [YES/NO]

    • < If NO, why? >
  • Any backward-incompatible changes? [YES/NO]

    • < If YES, why? >
    • < For this purpose, we define backward-incompatible changes as changes that—when consumed—can potentially result in
      errors for users that are using our public APIs or the entities that have public visibility in our code-base. >
  • Any new external dependencies? [YES/NO]

    • < If YES, which ones and why? >
    • < In addition, please also mention any other alternatives you've considered and the reason they've been discarded >
  • Do your changes comply with the Contributing Guidelines
    and Code Style Guidelines? [YES/NO]

License Information

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

Copy link

github-actions bot commented Feb 14, 2024

Conformance comparison report-Cross Engine

Base (eval) legacy +/-
% Passing 55.59% 92.47% 36.89%
✅ Passing 3234 5380 2146
❌ Failing 2584 438 -2146
🔶 Ignored 0 0 0
Total Tests 5818 5818 0
Number passing in both: 3228

Number failing in both: 432

Number passing in eval engine but fail in legacy engine: 6

Number failing in eval engine but pass in legacy engine: 2152
⁉️ CONFORMANCE REPORT REGRESSION DETECTED ⁉️. The following test(s) are passing in eval but fail in legacy:

Click here to see
  • nullif valid cases{first:"missing",second:"missing",result:missing}, compileOption: PERMISSIVE
  • nullif valid cases{first:"missing",second:"missing",result:missing}, compileOption: LEGACY
  • offset 2^63, compileOption: PERMISSIVE
  • offset 2^63, compileOption: LEGACY
  • offset 1-2, compileOption: PERMISSIVE
  • missing and true, compileOption: PERMISSIVE
2152 test(s) were failing in eval but now pass in legacy. 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.

Conformance comparison report-Cross Commit-EVAL

Base (339bd05) f58b5cf +/-
% Passing 55.55% 55.59% 0.03%
✅ Passing 3232 3234 2
❌ Failing 2586 2584 -2
🔶 Ignored 0 0 0
Total Tests 5818 5818 0
Number passing in both: 3207

Number failing in both: 2559

Number passing in Base (339bd05) but now fail: 25

Number failing in Base (339bd05) but now pass: 27
⁉️ CONFORMANCE REPORT REGRESSION DETECTED ⁉️
The complete list can be found in GitHub CI summary, either from Step Summary or in the Artifact.
27 test(s) were previously failing but now pass. 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.

Conformance comparison report-Cross Commit-LEGACY

Base (339bd05) f58b5cf +/-
% Passing 92.47% 92.47% 0.00%
✅ Passing 5380 5380 0
❌ Failing 438 438 0
🔶 Ignored 0 0 0
Total Tests 5818 5818 0
Number passing in both: 5380

Number failing in both: 438

Number passing in Base (339bd05) but now fail: 0

Number failing in Base (339bd05) but now pass: 0

@codecov-commenter
Copy link

codecov-commenter commented Feb 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (partiql-eval@8f3c7f2). Click here to learn what that means.

Additional details and impacted files
@@               Coverage Diff               @@
##             partiql-eval    #1371   +/-   ##
===============================================
  Coverage                ?   50.32%           
  Complexity              ?     1045           
===============================================
  Files                   ?      165           
  Lines                   ?    13129           
  Branches                ?     2452           
===============================================
  Hits                    ?     6607           
  Misses                  ?     5862           
  Partials                ?      660           
Flag Coverage Δ
CLI 13.77% <ø> (?)
EXAMPLES 80.28% <ø> (?)
LANG 54.71% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yliuuuu yliuuuu marked this pull request as ready for review February 14, 2024 18:53
Comment on lines 278 to 286
limit::{
input: rel,
limit: rex,
},

offset::{
input: rel,
offset: rex,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

LIMIT NULL is not the same as LIMIT 0.

I had originally modeled LIMIT..OFFSET as the FETCH operator, because FETCH is defined in the SQL specification whereas LIMIT and OFFSET are not actually defined the SQL spec (92 or 99).

However, PartiQL allows for OFFSET without LIMIT hence why I split them into their own operators. I don't think we should consolidate, but if that is agreed to be better then it should at least be called FETCH

@yliuuuu yliuuuu force-pushed the partiql-eval-limit-offset branch from 9eb595b to 9dd2b6c Compare February 19, 2024 23:24
@yliuuuu yliuuuu requested a review from rchowell February 19, 2024 23:28
@yliuuuu yliuuuu merged commit f1aeb6f into partiql-eval Feb 20, 2024
10 checks passed
@yliuuuu yliuuuu deleted the partiql-eval-limit-offset branch February 20, 2024 18:59
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.

3 participants