From cb392308e21eb4408224a530b801bf8450dadb8d Mon Sep 17 00:00:00 2001 From: Zhangsibing <1948879100@qq.com> Date: Mon, 13 Dec 2021 11:18:21 +0800 Subject: [PATCH] KE-14893 fix calcite query error that select one field from a lookup use snapshot,just one field is visible in cube --- cassandra/pom.xml | 4 ++-- core/pom.xml | 4 ++-- .../org/apache/calcite/adapter/enumerable/PhysTypeImpl.java | 4 ++++ .../java/org/apache/calcite/prepare/CalcitePrepareImpl.java | 2 ++ druid/pom.xml | 4 ++-- elasticsearch2/pom.xml | 4 ++-- elasticsearch5/pom.xml | 4 ++-- example/csv/pom.xml | 4 ++-- example/function/pom.xml | 4 ++-- example/pom.xml | 4 ++-- file/pom.xml | 4 ++-- geode/pom.xml | 4 ++-- linq4j/pom.xml | 4 ++-- mongodb/pom.xml | 4 ++-- pig/pom.xml | 4 ++-- piglet/pom.xml | 4 ++-- plus/pom.xml | 4 ++-- pom.xml | 2 +- server/pom.xml | 4 ++-- spark/pom.xml | 4 ++-- splunk/pom.xml | 4 ++-- ubenchmark/pom.xml | 2 +- 22 files changed, 44 insertions(+), 38 deletions(-) diff --git a/cassandra/pom.xml b/cassandra/pom.xml index 31c5be6546ba..9499050cf33d 100644 --- a/cassandra/pom.xml +++ b/cassandra/pom.xml @@ -20,12 +20,12 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 calcite-cassandra jar - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 Calcite Cassandra Cassandra adapter for Calcite diff --git a/core/pom.xml b/core/pom.xml index c49139a24941..be459e1d06b6 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -20,12 +20,12 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 calcite-core jar - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 Calcite Core Core Calcite APIs and engine. diff --git a/core/src/main/java/org/apache/calcite/adapter/enumerable/PhysTypeImpl.java b/core/src/main/java/org/apache/calcite/adapter/enumerable/PhysTypeImpl.java index 487ddee8766c..5bf62ada0a93 100644 --- a/core/src/main/java/org/apache/calcite/adapter/enumerable/PhysTypeImpl.java +++ b/core/src/main/java/org/apache/calcite/adapter/enumerable/PhysTypeImpl.java @@ -52,6 +52,7 @@ import static org.apache.calcite.adapter.enumerable.EnumUtils.javaRowClass; import static org.apache.calcite.adapter.enumerable.EnumUtils.overridingMethodDecl; +import static org.apache.calcite.prepare.CalcitePrepareImpl.OPTIMIZE_JAVA_ROW_FORMAT; /** Implementation of {@link PhysType}. */ public class PhysTypeImpl implements PhysType { @@ -80,6 +81,9 @@ public static PhysType of( JavaTypeFactory typeFactory, RelDataType rowType, JavaRowFormat format) { + if (OPTIMIZE_JAVA_ROW_FORMAT.get() == null || !OPTIMIZE_JAVA_ROW_FORMAT.get()) { + return of(typeFactory, rowType, format, false); + } return of(typeFactory, rowType, format, true); } diff --git a/core/src/main/java/org/apache/calcite/prepare/CalcitePrepareImpl.java b/core/src/main/java/org/apache/calcite/prepare/CalcitePrepareImpl.java index ec1fb703fd8a..42d354ae9418 100644 --- a/core/src/main/java/org/apache/calcite/prepare/CalcitePrepareImpl.java +++ b/core/src/main/java/org/apache/calcite/prepare/CalcitePrepareImpl.java @@ -188,6 +188,8 @@ public class CalcitePrepareImpl implements CalcitePrepare { public static final ThreadLocal FIX_INTEGER_DIVIDE_INTEGER_TYPE = new ThreadLocal<>(); + public static final ThreadLocal OPTIMIZE_JAVA_ROW_FORMAT = new ThreadLocal<>(); + public static final boolean COMMUTE = Util.getBooleanProperty("calcite.enable.join.commute"); diff --git a/druid/pom.xml b/druid/pom.xml index 7a10bd0d00aa..77df062052a9 100644 --- a/druid/pom.xml +++ b/druid/pom.xml @@ -20,12 +20,12 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 calcite-druid jar - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 Calcite Druid Druid adapter for Calcite diff --git a/elasticsearch2/pom.xml b/elasticsearch2/pom.xml index b4bcf7c9efdb..7ba7a8549207 100644 --- a/elasticsearch2/pom.xml +++ b/elasticsearch2/pom.xml @@ -21,12 +21,12 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 calcite-elasticsearch2 jar - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 Calcite Elasticsearch Elasticsearch adapter for Calcite diff --git a/elasticsearch5/pom.xml b/elasticsearch5/pom.xml index db7e3dc35365..abe43dc60806 100644 --- a/elasticsearch5/pom.xml +++ b/elasticsearch5/pom.xml @@ -21,12 +21,12 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 calcite-elasticsearch5 jar - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 Calcite Elasticsearch5 Elasticsearch5 adapter for Calcite diff --git a/example/csv/pom.xml b/example/csv/pom.xml index 07f454140a43..5d2e9e391f03 100644 --- a/example/csv/pom.xml +++ b/example/csv/pom.xml @@ -20,12 +20,12 @@ limitations under the License. org.apache.calcite calcite-example - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 calcite-example-csv jar - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 Calcite Example CSV An example Calcite provider that reads CSV files diff --git a/example/function/pom.xml b/example/function/pom.xml index 96154bc72306..91dbd7ebcbb3 100644 --- a/example/function/pom.xml +++ b/example/function/pom.xml @@ -20,12 +20,12 @@ limitations under the License. org.apache.calcite calcite-example - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 calcite-example-function jar - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 Calcite Example Function Examples of user-defined Calcite functions diff --git a/example/pom.xml b/example/pom.xml index 4203089830fa..c21242b0b9b9 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -20,13 +20,13 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 calcite-example pom - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 Calcite Examples Calcite examples diff --git a/file/pom.xml b/file/pom.xml index 84d6b84ac714..82a77a266839 100644 --- a/file/pom.xml +++ b/file/pom.xml @@ -19,13 +19,13 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 calcite-file jar - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 Calcite File Calcite provider that reads files and URIs diff --git a/geode/pom.xml b/geode/pom.xml index 36ddfda16228..35a18a3b26ff 100644 --- a/geode/pom.xml +++ b/geode/pom.xml @@ -20,12 +20,12 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 calcite-geode jar - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 Calcite Geode Geode adapter for Calcite diff --git a/linq4j/pom.xml b/linq4j/pom.xml index 53c971c408d6..428392679a60 100644 --- a/linq4j/pom.xml +++ b/linq4j/pom.xml @@ -20,12 +20,12 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 calcite-linq4j jar - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 Calcite Linq4j Calcite APIs for LINQ (Language-Integrated Query) in Java diff --git a/mongodb/pom.xml b/mongodb/pom.xml index a9314dbd0c0d..f94dde57f077 100644 --- a/mongodb/pom.xml +++ b/mongodb/pom.xml @@ -20,12 +20,12 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 calcite-mongodb jar - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 Calcite MongoDB MongoDB adapter for Calcite diff --git a/pig/pom.xml b/pig/pom.xml index c3edf342b94c..0ca49c3ca3bf 100644 --- a/pig/pom.xml +++ b/pig/pom.xml @@ -20,12 +20,12 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 calcite-pig jar - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 Calcite Pig Pig adapter for Calcite diff --git a/piglet/pom.xml b/piglet/pom.xml index cfb9189399d6..769590b9ab4a 100644 --- a/piglet/pom.xml +++ b/piglet/pom.xml @@ -20,12 +20,12 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 calcite-piglet jar - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 Calcite Piglet Pig-like language built on top of Calcite algebra diff --git a/plus/pom.xml b/plus/pom.xml index 121f7b65d5de..ac96e59cd057 100644 --- a/plus/pom.xml +++ b/plus/pom.xml @@ -20,12 +20,12 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 calcite-plus jar - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 Calcite Plus Miscellaneous extras for Calcite diff --git a/pom.xml b/pom.xml index 311ee0285970..6db4a55c4b21 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ limitations under the License. org.apache.calcite calcite pom - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 Calcite diff --git a/server/pom.xml b/server/pom.xml index 74f7bb893e2c..cee3019e5704 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -20,12 +20,12 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 calcite-server jar - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 Calcite Server Calcite Server diff --git a/spark/pom.xml b/spark/pom.xml index 8cc91c0ba8dd..d75306358f37 100644 --- a/spark/pom.xml +++ b/spark/pom.xml @@ -20,12 +20,12 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 calcite-spark jar - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 Calcite Spark diff --git a/splunk/pom.xml b/splunk/pom.xml index 408161c0c3e5..a4dfdec22987 100644 --- a/splunk/pom.xml +++ b/splunk/pom.xml @@ -20,12 +20,12 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 calcite-splunk jar - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59 Calcite Splunk Splunk adapter for Calcite; also a JDBC driver for Splunk diff --git a/ubenchmark/pom.xml b/ubenchmark/pom.xml index e48fe0076c49..f8dc936d697f 100644 --- a/ubenchmark/pom.xml +++ b/ubenchmark/pom.xml @@ -20,7 +20,7 @@ limitations under the License. org.apache.calcite calcite - 1.16.0-kylin-3.x-r58 + 1.16.0-kylin-3.x-r59