Skip to content

Commit

Permalink
[FLINK-21239][table] Update Calcite to 1.28.0
Browse files Browse the repository at this point in the history
This closes apache#21203.
  • Loading branch information
snuyanzin authored and twalthr committed Dec 9, 2022
1 parent 636c133 commit c05eab6
Show file tree
Hide file tree
Showing 23 changed files with 6,908 additions and 302 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.apache.flink.shaded.guava30.com.google.common.collect.Iterators;

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Arrays;
Expand Down Expand Up @@ -189,6 +190,17 @@ public URL getResource(final String name) {
return null;
}

@Override
public InputStream getResourceAsStream(String name) {
if (isComponentFirstClass(name)) {
return super.getResourceAsStream(name);
}
if (isOwnerFirstClass(name)) {
return ownerClassLoader.getResourceAsStream(name);
}
return super.getResourceAsStream(name);
}

@Override
public Enumeration<URL> getResources(final String name) throws IOException {
if (isComponentFirstResource(name)) {
Expand Down
4 changes: 4 additions & 0 deletions flink-table/flink-sql-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@ under the License.
<groupId>org.apache.calcite</groupId>
<artifactId>calcite-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite-testkit</artifactId>
</exclusion>
</exclusions>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ Was expecting one of:
<BRACKET_QUOTED_IDENTIFIER> ...
<QUOTED_IDENTIFIER> ...
<BACK_QUOTED_IDENTIFIER> ...
<BIG_QUERY_BACK_QUOTED_IDENTIFIER> ...
<HYPHENATED_IDENTIFIER> ...
<IDENTIFIER> ...
<UNICODE_QUOTED_IDENTIFIER> ...
Expand Down
121 changes: 120 additions & 1 deletion flink-table/flink-sql-parser-hive/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,68 @@ under the License.
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite-core</artifactId>
<version>${calcite.version}</version>
<exclusions>
<!--
"mvn dependency:tree" as of Calcite 1.28.0:
[INFO] +- org.apache.calcite:calcite-core:jar:1.28.0:compile
[INFO] | +- org.apache.calcite.avatica:avatica-core:jar:1.19.0:compile
[INFO] | +- org.checkerframework:checker-qual:jar:3.10.0:compile
Dependencies that are not needed for how we use Calcite right now.
-->
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-dbcp2</artifactId>
</exclusion>
<exclusion>
<groupId>com.esri.geometry</groupId>
<artifactId>esri-geometry-api</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
</exclusion>
<exclusion>
<groupId>com.yahoo.datasketches</groupId>
<artifactId>sketches-core</artifactId>
</exclusion>
<exclusion>
<groupId>net.hydromatic</groupId>
<artifactId>aggdesigner-algorithm</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.calcite.avatica</groupId>
<artifactId>avatica-server</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.calcite.avatica</groupId>
<artifactId>avatica-metrics</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
Expand All @@ -97,9 +150,75 @@ under the License.
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_annotations</artifactId>
</exclusion>
<exclusion>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
</exclusion>
<exclusion>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite-linq4j</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.janino</groupId>
<artifactId>janino</artifactId>
</exclusion>
<exclusion>
<groupId>org.codehaus.janino</groupId>
<artifactId>commons-compiler</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</exclusion>
<exclusion>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
<exclusion>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
</exclusion>
<exclusion>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite-testkit</artifactId>
<version>${calcite.version}</version>
<scope>test</scope>
<type>test-jar</type>
<exclusions>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-dbcp2</artifactId>
</exclusion>
<exclusion>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite-linq4j</artifactId>
<version>${calcite.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.apiguardian</groupId>
<artifactId>apiguardian-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
Expand Down
63 changes: 43 additions & 20 deletions flink-table/flink-sql-parser/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ under the License.
<version>${calcite.version}</version>
<exclusions>
<!--
"mvn dependency:tree" as of Calcite 1.27.0:
"mvn dependency:tree" as of Calcite 1.28.0:
[INFO] +- org.apache.calcite:calcite-core:jar:1.27.0:compile
[INFO] | +- org.apache.calcite.avatica:avatica-core:jar:1.18.0:compile
[INFO] +- org.apache.calcite:calcite-core:jar:1.28.0:compile
[INFO] | +- org.apache.calcite.avatica:avatica-core:jar:1.19.0:compile
[INFO] | \- org.checkerframework:checker-qual:jar:3.10.0:compile
Dependencies that are not needed for how we use Calcite right now.
Expand Down Expand Up @@ -171,45 +171,68 @@ under the License.
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_annotations</artifactId>
</exclusion>
<exclusion>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
</exclusion>
<exclusion>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite-core</artifactId>
<artifactId>calcite-testkit</artifactId>
<version>${calcite.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.apache.calcite.avatica</groupId>
<artifactId>avatica-server</artifactId>
<groupId>org.apache.commons</groupId>
<artifactId>commons-dbcp2</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.uzaygezen</groupId>
<artifactId>uzaygezen-core</artifactId>
<groupId>net.hydromatic</groupId>
<artifactId>quidem</artifactId>
</exclusion>
<!-- Excluding org.apiguardian:apiguardian-api v1.1.0 because org.junit.jupiter:junit-jupiter contains newer version v1.1.2 -->
<exclusion>
<groupId>org.apiguardian</groupId>
<artifactId>apiguardian-api</artifactId>
<groupId>net.hydromatic</groupId>
<artifactId>foodmart-data-hsqldb</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_annotations</artifactId>
<groupId>net.hydromatic</groupId>
<artifactId>foodmart-queries</artifactId>
</exclusion>
<exclusion>
<groupId>net.hydromatic</groupId>
<artifactId>scott-data-hsqldb</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.calcite</groupId>
<artifactId>calcite-linq4j</artifactId>
<version>${calcite.version}</version>
<scope>test</scope>
<type>test-jar</type>
<exclusions>
<!-- Excluding org.apiguardian:apiguardian-api v1.1.0 because org.junit.jupiter:junit-jupiter contains newer version v1.1.2 -->
<exclusion>
<groupId>org.apiguardian</groupId>
<artifactId>apiguardian-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ void testInvalidNoSourceTable() {
+ " <BRACKET_QUOTED_IDENTIFIER> ...\n"
+ " <QUOTED_IDENTIFIER> ...\n"
+ " <BACK_QUOTED_IDENTIFIER> ...\n"
+ " <BIG_QUERY_BACK_QUOTED_IDENTIFIER> ...\n"
+ " <HYPHENATED_IDENTIFIER> ...\n"
+ " <IDENTIFIER> ...\n"
+ " <UNICODE_QUOTED_IDENTIFIER> ...\n");
Expand Down
34 changes: 27 additions & 7 deletions flink-table/flink-table-planner/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ under the License.
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.immutables</groupId>
<artifactId>value</artifactId>
<version>2.8.8</version>
</dependency>
<dependency>
<groupId>org.immutables</groupId>
<artifactId>value-annotations</artifactId>
<version>2.8.8</version>
</dependency>


<dependency>
<groupId>org.codehaus.janino</groupId>
<artifactId>commons-compiler</artifactId>
Expand Down Expand Up @@ -128,15 +140,15 @@ under the License.
<version>${calcite.version}</version>
<exclusions>
<!--
"mvn dependency:tree" as of Calcite 1.27.0:
"mvn dependency:tree" as of Calcite 1.28.0:
[INFO] +- org.apache.calcite:calcite-core:jar:1.27.0:compile
[INFO] | +- org.apache.calcite:calcite-linq4j:jar:1.27.0:compile
[INFO] +- org.apache.calcite:calcite-core:jar:1.28.0:compile
[INFO] | +- org.apache.calcite:calcite-linq4j:jar:1.28.0:compile
[INFO] | +- com.esri.geometry:esri-geometry-api:jar:2.2.0:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.13.2:compile
[INFO] | +- org.apache.calcite.avatica:avatica-core:jar:1.18.0:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-core:jar:2.13.2:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.13.2.2:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.13.4:compile
[INFO] | +- org.apache.calcite.avatica:avatica-core:jar:1.19.0:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-core:jar:2.13.4:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.13.4.2:compile
[INFO] | +- com.jayway.jsonpath:json-path:jar:2.4.0:runtime
[INFO] | | \- net.minidev:json-smart:jar:2.3:runtime
[INFO] | | \- net.minidev:accessors-smart:jar:1.2:runtime
Expand Down Expand Up @@ -200,6 +212,14 @@ under the License.
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_annotations</artifactId>
</exclusion>
<exclusion>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
</exclusion>
<exclusion>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
</exclusion>
</exclusions>
</dependency>

Expand Down
Loading

0 comments on commit c05eab6

Please sign in to comment.