-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
sql: add support for GROUPING SETS, CUBE, and ROLLUP #46280
Comments
cc @awoods187 |
we need this |
54536: sql: add unimplemented errors for trigrams r=solongordon a=otan Resolves #51137 **sql: add unimplemented errors for index with operator classes** * Amend lexing to do lookahead for NULLS FIRST / NULLS LAST to avoid shift/reduce conflicts. * Amend index_params support to be Postgre-compatible. Doing a_exprs inside indexes now require surrounding braces. * Add operator_class argument to index_params. * Add unimplemented error for operator class support. Release note: None **builtins: add unimplemented notices around trigram builtins** Release note: None 54541: opt: build constraint for containment operator r=rytaft a=mgartner This commit builds a non-tight, non-null constraint for containment operators. This is valid because `NULL` cannot contain any elements. This fixes a minor issue with the statistics of partial inverted index scans. Tests for these scans have been added for in this commit. Release note: None 54558: opt: deduce not-null constraints for functions with non-nullable args r=rytaft a=rytaft Release justification: low risk, high benefit changes to existing functionality, bug fixes and low-risk updates to new functionality This commit enhances the constraint builder code so that it can deduce not-null constraints for any variable arguments to functions with non- nullable args. This is important for improving optimizer support for spatial functions, since many of these functions have non-nullable args and are used as filter predicates. Deducing not-null constraints for the arguments to these functions enables us to calculate more accurate statistics, and may unlock other optimizations. Release note (performance improvement): The optimizer can now deduce that certain variable arguments to functions must be non-null. This improves cardinality estimation for those variables and unlocks other types of optimizations. As a result, the optimizer may choose better query plans when a function is used as a filter predicate. 54579: parser: add unimplemented for GROUP BY {GROUPING SETS, ROLLUP, CUBE} r=solongordon a=otan Refs #51424 Refs #46280 Release note: None 54582: parser: add unimplemented error for COPY ... WHERE ... r=solongordon a=otan Refs #54580 Refs #51424 Release note: None Co-authored-by: Oliver Tan <otan@cockroachlabs.com> Co-authored-by: Marcus Gartner <marcus@cockroachlabs.com> Co-authored-by: Rebecca Taft <becca@cockroachlabs.com>
is there a timeline on this feature? if not, i'm going to install spark and/or pandas for in-memory post-processing.... |
cc @vy-ton |
@vitruvvius We don't have a timeline for this feature yet. If you could share a sample query/use case that would help future prioritization? |
@vy-ton i could use CUBE for saving []float64, usually i use CUBE for saving my machine learning encoding data |
rollups are very common when computing analytics for customers - ie, pivot tables |
All of these seem like they can be implemented with transformations in the optimizer. Check out these pages: SQL GROUPING SETS - Generate Multiple Grouping Sets, SQL ROLLUP, SQL CUBE The example in the
can be rewritten as:
I think we can perform similar transformations for the others as well. |
manually reviewed and brought up to date |
We have marked this issue as stale because it has been inactive for |
According to Postgres docs:
We (maybe) should add support for
GROUPING SETS
,CUBE
, andROLLUP
.I have no idea how hard that would be, but 7 out 99 queries of TPC-DS benchmark use
rollup
.Jira issue: CRDB-5096
The text was updated successfully, but these errors were encountered: