You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ro...@apache.org on 2023/01/24 05:09:02 UTC
[pinot] branch master updated: fixing IN subquery compilation issue (#10168)
This is an automated email from the ASF dual-hosted git repository.
rongr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git
The following commit(s) were added to refs/heads/master by this push:
new 12d54127ae fixing IN subquery compilation issue (#10168)
12d54127ae is described below
commit 12d54127aec0c3bd5148663ad41ef8aab3075acf
Author: Rong Rong <ro...@apache.org>
AuthorDate: Mon Jan 23 21:08:56 2023 -0800
fixing IN subquery compilation issue (#10168)
Co-authored-by: Rong Rong <ro...@startree.ai>
---
.../src/main/java/org/apache/pinot/query/QueryEnvironment.java | 2 ++
.../src/test/resources/queries/TableExpressions.json | 7 +++++++
2 files changed, 9 insertions(+)
diff --git a/pinot-query-planner/src/main/java/org/apache/pinot/query/QueryEnvironment.java b/pinot-query-planner/src/main/java/org/apache/pinot/query/QueryEnvironment.java
index c58cfc59f4..3fa2f58d65 100644
--- a/pinot-query-planner/src/main/java/org/apache/pinot/query/QueryEnvironment.java
+++ b/pinot-query-planner/src/main/java/org/apache/pinot/query/QueryEnvironment.java
@@ -102,6 +102,8 @@ public class QueryEnvironment {
.defaultSchema(_rootSchema.plus())
.sqlToRelConverterConfig(SqlToRelConverter.config()
.withHintStrategyTable(getHintStrategyTable())
+ // SUB-QUERY Threshold is useless as we are encoding all IN clause in-line anyway
+ .withInSubQueryThreshold(Integer.MAX_VALUE)
.addRelBuilderConfigTransform(c -> c.withPushJoinCondition(true))
.addRelBuilderConfigTransform(c -> c.withAggregateUnique(true)))
.build();
diff --git a/pinot-query-runtime/src/test/resources/queries/TableExpressions.json b/pinot-query-runtime/src/test/resources/queries/TableExpressions.json
index ada612fc1e..765cd687e0 100644
--- a/pinot-query-runtime/src/test/resources/queries/TableExpressions.json
+++ b/pinot-query-runtime/src/test/resources/queries/TableExpressions.json
@@ -12,6 +12,9 @@
["bar", 2],
["alice", 42],
["bob", 196883]
+ ],
+ "partitionColumns": [
+ "strCol"
]
}
},
@@ -22,6 +25,10 @@
{ "sql": "SELECT * FROM {tbl} WHERE intCol > 5" },
{ "sql": "SELECT * FROM {tbl} WHERE strCol IN ('foo', 'bar')" },
{ "sql": "SELECT * FROM {tbl} WHERE intCol IN (196883, 42)" },
+ { "sql": "SELECT * FROM {tbl} WHERE strCol IN ('foo', 'bar', 'foo', 'bar', 'foo', 'bar', 'foo', 'bar', 'foo', 'bar', 'foo', 'bar', 'foo', 'bar', 'foo', 'bar', 'foo', 'bar', 'foo', 'bar', 'foo', 'bar', 'foo', 'bar', 'foo', 'bar', 'foo', 'bar', 'foo', 'bar')" },
+ { "sql": "SELECT * FROM {tbl} WHERE intCol IN (1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 20, 21, 22, 23, 24, 25, 26, 27, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)" },
+ { "sql": "SELECT * FROM {tbl} WHERE strCol NOT IN ('foo', 'bar', 'foo', 'bar', 'foo', 'bar', 'foo', 'bar', 'foo', 'bar', 'foo', 'bar', 'foo', 'bar', 'foo', 'bar', 'foo', 'bar', 'foo', 'bar', 'foo', 'bar', 'foo', 'bar', 'foo', 'bar', 'foo', 'bar', 'foo', 'bar')" },
+ { "sql": "SELECT * FROM {tbl} WHERE intCol NOT IN (1, 2, 3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 20, 21, 22, 23, 24, 25, 26, 27, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)" },
{ "sql": "SELECT * FROM {tbl} WHERE intCol NOT IN (196883, 42) AND strCol IN ('alice')" },
{ "sql": "SELECT * FROM {tbl} WHERE strCol IN (SELECT strCol FROM {tbl} WHERE intCol > 100)" },
{ "sql": "SELECT * FROM {tbl} WHERE intCol < (SELECT SUM(intCol) FROM {tbl} AS b WHERE strCol BETWEEN 'bar' AND 'foo')" },
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org