Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ public OptExpression rewrite(OptExpression root, TaskContext taskContext) {
!GlobalStateMgr.getCurrentState().getNodeMgr().getClusterInfo().isSingleBackendAndComputeNode()) {
return root;
}
if (sv.isEnableQueryCache()) {
return root;
}

return root.getOp().accept(VISITOR, root, null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ private boolean canGenerateOneStageAgg(GroupExpression childBestExpr) {
return false;
}

if (sv.isEnableLocalShuffleAgg() &&
if (sv.isEnableLocalShuffleAgg() && !sv.isEnableQueryCache() &&
GlobalStateMgr.getCurrentState().getNodeMgr().getClusterInfo().isSingleBackendAndComputeNode()) {
return true;
}
Expand Down
35 changes: 35 additions & 0 deletions test/sql/test_query_cache/R/test_query_cache_with_localshuffle_agg
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
-- name: test_query_cache_with_localshuffle_agg
CREATE TABLE t1 (
id int(11) NOT NULL,
category varchar(192) NULL
) ENGINE=OLAP
PRIMARY KEY(id)
DISTRIBUTED BY HASH(id) BUCKETS 10
PROPERTIES (
"compression" = "LZ4",
"enable_persistent_index" = "true",
"fast_schema_evolution" = "true",
"replicated_storage" = "true",
"replication_num" = "1"
);
-- result:
-- !result
INSERT INTO t1 (id, category)
SELECT generate_series,
CONCAT('cat-', CAST(generate_series % 10 AS STRING))
FROM TABLE(generate_series(1, 1000));
-- result:
-- !result
SELECT category, COUNT(*) FROM t1 GROUP BY category ORDER BY category limit 10;
-- result:
cat-0 100
cat-1 100
cat-2 100
cat-3 100
cat-4 100
cat-5 100
cat-6 100
cat-7 100
cat-8 100
cat-9 100
-- !result
22 changes: 22 additions & 0 deletions test/sql/test_query_cache/T/test_query_cache_with_localshuffle_agg
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
-- name: test_query_cache_with_localshuffle_agg

CREATE TABLE t1 (
id int(11) NOT NULL,
category varchar(192) NULL
) ENGINE=OLAP
PRIMARY KEY(id)
DISTRIBUTED BY HASH(id) BUCKETS 10
PROPERTIES (
"compression" = "LZ4",
"enable_persistent_index" = "true",
"fast_schema_evolution" = "true",
"replicated_storage" = "true",
"replication_num" = "1"
);

INSERT INTO t1 (id, category)
SELECT generate_series,
CONCAT('cat-', CAST(generate_series % 10 AS STRING))
FROM TABLE(generate_series(1, 1000));

SELECT category, COUNT(*) FROM t1 GROUP BY category ORDER BY category limit 10;
Comment thread
stdpain marked this conversation as resolved.
Loading