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

feat(sql): support window (union = (last join)) in online serving mode #3205

Merged

Conversation

aceforeverd
Copy link
Collaborator

@aceforeverd aceforeverd commented Apr 10, 2023

select ..
from t
window w as (
   union (select .. from t2 last t3 on ...)
   partition by .. order by ...
)

->

AggNode
  RequestUnion
    Request(t)
    Table(t)
    WindowUnions
      SimpleProject
        RequestJoin
          Partition(t2)
          Partition(t3)
  • t2 should optimized by window definition
  • t3 should optimized by join condition

@github-actions github-actions bot added the execute-engine hybridse sql engine label Apr 10, 2023
@codecov
Copy link

codecov bot commented Apr 10, 2023

Codecov Report

Patch coverage: 68.37% and project coverage change: -3.46 ⚠️

Comparison is base (bbf61f6) 79.04% compared to head (38d6203) 75.58%.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #3205      +/-   ##
============================================
- Coverage     79.04%   75.58%   -3.46%     
- Complexity        0      393     +393     
============================================
  Files           516      679     +163     
  Lines        116012   125517    +9505     
  Branches          0     1180    +1180     
============================================
+ Hits          91705    94876    +3171     
- Misses        24291    30405    +6114     
- Partials         16      236     +220     
Impacted Files Coverage Δ
hybridse/src/vm/catalog_wrapper.h 46.22% <12.50%> (-3.96%) ⬇️
hybridse/src/vm/catalog_wrapper.cc 39.02% <46.15%> (+12.35%) ⬆️
hybridse/src/vm/generator.cc 64.39% <64.39%> (ø)
hybridse/src/vm/runner.cc 69.25% <78.00%> (+1.47%) ⬆️
...se/src/passes/physical/group_and_sort_optimized.cc 76.83% <83.33%> (+0.18%) ⬆️
...ybridse/src/passes/physical/condition_optimized.cc 86.58% <85.71%> (-0.04%) ⬇️
hybridse/src/vm/generator.h 98.21% <98.21%> (ø)
hybridse/src/vm/runner.h 91.44% <100.00%> (-1.41%) ⬇️
hybridse/src/vm/transform.cc 84.04% <100.00%> (+0.03%) ⬆️

... and 175 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@aceforeverd aceforeverd marked this pull request as ready for review April 11, 2023 13:49
@aceforeverd aceforeverd changed the title feat(wip): support window (union = (last join)) in online serving mode feat(sql): support window (union = (last join)) in online serving mode Apr 11, 2023
@aceforeverd
Copy link
Collaborator Author

aceforeverd commented Apr 13, 2023

TODO further:

  • lazy last join for batch / batch request mode
  • more test cases
  • window ( union = multiple join )
  • related doc update

Copy link
Collaborator

@tobegit3hub tobegit3hub left a comment

Choose a reason for hiding this comment

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

LGTM

@aceforeverd aceforeverd merged commit 8be23b8 into 4paradigm:main Apr 19, 2023
@aceforeverd aceforeverd deleted the feat-window-union-over-last-join branch April 19, 2023 07:38
@lumianph lumianph added the alpha this feature is not fully tested or functional label Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alpha this feature is not fully tested or functional execute-engine hybridse sql engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants