-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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(cubesql): Penalize zero members in wrapper #8927
base: master
Are you sure you want to change the base?
Conversation
eca2925
to
da51ec9
Compare
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 8 Skipped Deployments
|
* Now column names, introudced by Datafusion, would get renamed, and that would avoid sending too long aliases to Cube for SQL generation, and later to data source * Single CubeScan can represent join of multiple TableScans, they can have different table aliases, and columns on top of CubeScan can have different qualifiers. But generated SQL can have only one table alias, so all column expressions on top needs to be remapped as well
da51ec9
to
6376543
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8927 +/- ##
==========================================
+ Coverage 82.66% 82.70% +0.03%
==========================================
Files 221 221
Lines 78303 78455 +152
==========================================
+ Hits 64726 64883 +157
+ Misses 13577 13572 -5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Check List
Description of Changes Made (if issue reference is not provided)
This would allow to extract fully assembled
CubeScan
under wrapper instead ofCubeScan(allMembers, ungrouped=true)
.ATM there are two related components in cost:
non_detected_cube_scans
andcube_members
non_detected_cube_scans
allows to penalizeCubeScan
without members specifically outside the wrapper. This is pretty hard penalty, queries like that are Not Good™cube_members
allows to prefer queries will less members, which seems fine. But on it's own it would prefer query with zero member, which is, actually, all the members.So, new cost component added:
zero_members_wrapper
. It would stand right beforecube_members
, and allow to penalize no-members representation beforecube_members
starts impacting extraction.New
CubeScan
extractions surfaced a couple of bugs related to aliasing in generated SQL, hence all the supporting stuff in this PR.