Skip to content

Commit

Permalink
Revert "KE-14627 make constant folding in project configured and upgr…
Browse files Browse the repository at this point in the history
…ade to r45 (apache#159)"

This reverts commit 05a3318.
  • Loading branch information
huangfeng1993 committed Sep 24, 2020
1 parent 9389ecc commit 765fecc
Show file tree
Hide file tree
Showing 23 changed files with 37 additions and 54 deletions.
4 changes: 2 additions & 2 deletions cassandra/pom.xml
Expand Up @@ -20,12 +20,12 @@ limitations under the License.
<parent>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite</artifactId>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
</parent>

<artifactId>calcite-cassandra</artifactId>
<packaging>jar</packaging>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
<name>Calcite Cassandra</name>
<description>Cassandra adapter for Calcite</description>

Expand Down
4 changes: 2 additions & 2 deletions core/pom.xml
Expand Up @@ -20,12 +20,12 @@ limitations under the License.
<parent>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite</artifactId>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
</parent>

<artifactId>calcite-core</artifactId>
<packaging>jar</packaging>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
<name>Calcite Core</name>
<description>Core Calcite APIs and engine.</description>

Expand Down
Expand Up @@ -72,9 +72,6 @@ public interface CalciteConnectionConfig extends ConnectionConfig {
/* OVERRIDE POINT */
// https://github.com/Kyligence/KAP/issues/10964
boolean projectUnderRelRoot();

boolean skipConstantFoldingInProject();

// https://github.com/Kyligence/KAP/issues/17294
<T> T getCustomerValidation(Class<T> validationClass, T defaultValidation);
}
Expand Down
Expand Up @@ -203,10 +203,6 @@ public boolean projectUnderRelRoot() {
return CalciteConnectionProperty.PROJECT_UNDER_RELROOT.wrap(properties)
.getBoolean(true);
}

public boolean skipConstantFoldingInProject() {
return false;
}
}

// End CalciteConnectionConfigImpl.java
Expand Up @@ -17,7 +17,6 @@
package org.apache.calcite.rel.rules;


import org.apache.calcite.config.CalciteConnectionConfig;
import org.apache.calcite.plan.RelOptCluster;
import org.apache.calcite.plan.RelOptPredicateList;
import org.apache.calcite.plan.RelOptRule;
Expand Down Expand Up @@ -625,15 +624,7 @@ protected static boolean reduceExpressionsInternal(RelNode rel,
}

final List<RexNode> reducedValues = Lists.newArrayList();


CalciteConnectionConfig config =
rel.getCluster().getPlanner().getContext().unwrap(CalciteConnectionConfig.class);
if (config.skipConstantFoldingInProject()) {
reducedValues.addAll(constExps2);
} else {
executor.reduce(simplify.rexBuilder, constExps2, reducedValues);
}
executor.reduce(simplify.rexBuilder, constExps2, reducedValues);

// Use RexNode.digest to judge whether each newly generated RexNode
// is equivalent to the original one.
Expand Down
4 changes: 2 additions & 2 deletions druid/pom.xml
Expand Up @@ -20,12 +20,12 @@ limitations under the License.
<parent>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite</artifactId>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
</parent>

<artifactId>calcite-druid</artifactId>
<packaging>jar</packaging>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
<name>Calcite Druid</name>
<description>Druid adapter for Calcite</description>

Expand Down
4 changes: 2 additions & 2 deletions elasticsearch2/pom.xml
Expand Up @@ -21,12 +21,12 @@ limitations under the License.
<parent>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite</artifactId>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
</parent>

<artifactId>calcite-elasticsearch2</artifactId>
<packaging>jar</packaging>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
<name>Calcite Elasticsearch</name>
<description>Elasticsearch adapter for Calcite</description>

Expand Down
4 changes: 2 additions & 2 deletions elasticsearch5/pom.xml
Expand Up @@ -21,12 +21,12 @@ limitations under the License.
<parent>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite</artifactId>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
</parent>

<artifactId>calcite-elasticsearch5</artifactId>
<packaging>jar</packaging>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
<name>Calcite Elasticsearch5</name>
<description>Elasticsearch5 adapter for Calcite</description>

Expand Down
4 changes: 2 additions & 2 deletions example/csv/pom.xml
Expand Up @@ -20,12 +20,12 @@ limitations under the License.
<parent>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite-example</artifactId>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
</parent>

<artifactId>calcite-example-csv</artifactId>
<packaging>jar</packaging>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
<name>Calcite Example CSV</name>
<description>An example Calcite provider that reads CSV files</description>

Expand Down
4 changes: 2 additions & 2 deletions example/function/pom.xml
Expand Up @@ -20,12 +20,12 @@ limitations under the License.
<parent>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite-example</artifactId>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
</parent>

<artifactId>calcite-example-function</artifactId>
<packaging>jar</packaging>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
<name>Calcite Example Function</name>
<description>Examples of user-defined Calcite functions</description>

Expand Down
4 changes: 2 additions & 2 deletions example/pom.xml
Expand Up @@ -20,13 +20,13 @@ limitations under the License.
<parent>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite</artifactId>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
</parent>

<!-- The basics. -->
<artifactId>calcite-example</artifactId>
<packaging>pom</packaging>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
<name>Calcite Examples</name>
<description>Calcite examples</description>

Expand Down
4 changes: 2 additions & 2 deletions file/pom.xml
Expand Up @@ -19,13 +19,13 @@ limitations under the License.
<parent>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite</artifactId>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
</parent>

<!-- The basics. -->
<artifactId>calcite-file</artifactId>
<packaging>jar</packaging>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
<name>Calcite File</name>
<description>Calcite provider that reads files and URIs</description>

Expand Down
4 changes: 2 additions & 2 deletions geode/pom.xml
Expand Up @@ -20,12 +20,12 @@ limitations under the License.
<parent>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite</artifactId>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
</parent>

<artifactId>calcite-geode</artifactId>
<packaging>jar</packaging>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
<name>Calcite Geode</name>
<description>Geode adapter for Calcite</description>

Expand Down
4 changes: 2 additions & 2 deletions linq4j/pom.xml
Expand Up @@ -20,12 +20,12 @@ limitations under the License.
<parent>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite</artifactId>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
</parent>

<artifactId>calcite-linq4j</artifactId>
<packaging>jar</packaging>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
<name>Calcite Linq4j</name>
<description>Calcite APIs for LINQ (Language-Integrated Query) in Java</description>

Expand Down
2 changes: 1 addition & 1 deletion mongodb/pom.xml
Expand Up @@ -20,7 +20,7 @@ limitations under the License.
<parent>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite</artifactId>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
</parent>

<artifactId>calcite-mongodb</artifactId>
Expand Down
5 changes: 2 additions & 3 deletions pig/pom.xml
Expand Up @@ -20,12 +20,11 @@ limitations under the License.
<parent>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite</artifactId>
<version>1.16.0-kylin-4.x-r46</version>
</parent>
<version>1.16.0-kylin-4.x-r46</version></parent>

<artifactId>calcite-pig</artifactId>
<packaging>jar</packaging>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
<name>Calcite Pig</name>
<description>Pig adapter for Calcite</description>

Expand Down
4 changes: 2 additions & 2 deletions piglet/pom.xml
Expand Up @@ -20,12 +20,12 @@ limitations under the License.
<parent>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite</artifactId>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
</parent>

<artifactId>calcite-piglet</artifactId>
<packaging>jar</packaging>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
<name>Calcite Piglet</name>
<description>Pig-like language built on top of Calcite algebra</description>

Expand Down
4 changes: 2 additions & 2 deletions plus/pom.xml
Expand Up @@ -20,12 +20,12 @@ limitations under the License.
<parent>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite</artifactId>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
</parent>

<artifactId>calcite-plus</artifactId>
<packaging>jar</packaging>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
<name>Calcite Plus</name>
<description>Miscellaneous extras for Calcite</description>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -27,7 +27,7 @@ limitations under the License.
<groupId>org.apache.calcite</groupId>
<artifactId>calcite</artifactId>
<packaging>pom</packaging>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>

<!-- More project information. -->
<name>Calcite</name>
Expand Down
4 changes: 2 additions & 2 deletions server/pom.xml
Expand Up @@ -20,12 +20,12 @@ limitations under the License.
<parent>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite</artifactId>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
</parent>

<artifactId>calcite-server</artifactId>
<packaging>jar</packaging>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
<name>Calcite Server</name>
<description>Calcite Server</description>

Expand Down
4 changes: 2 additions & 2 deletions spark/pom.xml
Expand Up @@ -20,12 +20,12 @@ limitations under the License.
<parent>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite</artifactId>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
</parent>

<artifactId>calcite-spark</artifactId>
<packaging>jar</packaging>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
<name>Calcite Spark</name>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion splunk/pom.xml
Expand Up @@ -20,7 +20,7 @@ limitations under the License.
<parent>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite</artifactId>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
</parent>

<artifactId>calcite-splunk</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion ubenchmark/pom.xml
Expand Up @@ -20,7 +20,7 @@ limitations under the License.
<parent>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite</artifactId>
<version>1.16.0-kylin-4.x-r46</version>
<version>1.16.0-kylin-4.x-r46</version>
</parent>

<properties>
Expand Down

0 comments on commit 765fecc

Please sign in to comment.