mirror of https://github.com/citusdata/citus.git
Merge pull request #2507 from citusdata/error_out_grouping_sets_in_subqueries
Error out when a subquery has grouping set clausepull/2305/head
commit
a9c299473b
|
@ -807,6 +807,14 @@ DeferErrorIfCannotPushdownSubquery(Query *subqueryTree, bool outerMostQueryHasLi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* grouping sets are not allowed in subqueries*/
|
||||||
|
if (subqueryTree->groupingSets)
|
||||||
|
{
|
||||||
|
preconditionsSatisfied = false;
|
||||||
|
errorDetail = "could not run distributed query with GROUPING SETS, CUBE, "
|
||||||
|
"or ROLLUP";
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We support window functions when the window function
|
* We support window functions when the window function
|
||||||
* is partitioned on distribution column.
|
* is partitioned on distribution column.
|
||||||
|
|
|
@ -157,6 +157,17 @@ WHERE
|
||||||
;
|
;
|
||||||
ERROR: cannot push down this subquery
|
ERROR: cannot push down this subquery
|
||||||
DETAIL: Having qual without group by on partition column is currently unsupported when a subquery references a column from another query
|
DETAIL: Having qual without group by on partition column is currently unsupported when a subquery references a column from another query
|
||||||
|
-- We do not support GROUPING SETS in subqueries
|
||||||
|
-- This also includes ROLLUP or CUBE clauses
|
||||||
|
SELECT * FROM (SELECT user_id, value_1 FROM users_table GROUP BY GROUPING SETS ((user_id), (value_1))) s;
|
||||||
|
ERROR: could not run distributed query with GROUPING SETS, CUBE, or ROLLUP
|
||||||
|
HINT: Consider using an equality filter on the distributed table's partition column.
|
||||||
|
SELECT * FROM (SELECT user_id, value_1 FROM users_table GROUP BY ROLLUP (user_id, value_1)) s;
|
||||||
|
ERROR: could not run distributed query with GROUPING SETS, CUBE, or ROLLUP
|
||||||
|
HINT: Consider using an equality filter on the distributed table's partition column.
|
||||||
|
SELECT * FROM (SELECT user_id, value_1 FROM users_table GROUP BY CUBE (user_id, value_1)) s;
|
||||||
|
ERROR: could not run distributed query with GROUPING SETS, CUBE, or ROLLUP
|
||||||
|
HINT: Consider using an equality filter on the distributed table's partition column.
|
||||||
SET client_min_messages TO DEFAULT;
|
SET client_min_messages TO DEFAULT;
|
||||||
DROP SCHEMA not_supported CASCADE;
|
DROP SCHEMA not_supported CASCADE;
|
||||||
NOTICE: drop cascades to table users_table_local
|
NOTICE: drop cascades to table users_table_local
|
||||||
|
|
|
@ -149,6 +149,13 @@ WHERE
|
||||||
)
|
)
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
-- We do not support GROUPING SETS in subqueries
|
||||||
|
-- This also includes ROLLUP or CUBE clauses
|
||||||
|
SELECT * FROM (SELECT user_id, value_1 FROM users_table GROUP BY GROUPING SETS ((user_id), (value_1))) s;
|
||||||
|
SELECT * FROM (SELECT user_id, value_1 FROM users_table GROUP BY ROLLUP (user_id, value_1)) s;
|
||||||
|
SELECT * FROM (SELECT user_id, value_1 FROM users_table GROUP BY CUBE (user_id, value_1)) s;
|
||||||
|
|
||||||
SET client_min_messages TO DEFAULT;
|
SET client_min_messages TO DEFAULT;
|
||||||
|
|
||||||
DROP SCHEMA not_supported CASCADE;
|
DROP SCHEMA not_supported CASCADE;
|
||||||
|
|
Loading…
Reference in New Issue