[
https://issues.apache.org/jira/browse/BEAM-8331?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17014575#comment-17014575
]
Andrew Pilloud commented on BEAM-8331:
--------------------------------------
To reproduce this class of failure in Beam tests, apply this patch then run
./gradlew :sdks:java:extensions:sql:zetasql:test
{code:java}
diff --git a/sdks/java/extensions/sql/build.gradle
b/sdks/java/extensions/sql/build.gradle
index ee4db1645d..4e72227f4c 100644
--- a/sdks/java/extensions/sql/build.gradle
+++ b/sdks/java/extensions/sql/build.gradle
@@ -52,6 +52,7 @@ dependencies {
compile library.java.joda_time
compile library.java.vendored_calcite_1_20_0
compile "com.alibaba:fastjson:1.2.49"
+ compile "org.apache.calcite:calcite-core:1.20.0"
compile "org.codehaus.janino:janino:3.0.11"
compile "org.codehaus.janino:commons-compiler:3.0.11"
provided project(":sdks:java:io:kafka")
{code}
> Vendored calcite breaks if another calcite is on the class path
> ---------------------------------------------------------------
>
> Key: BEAM-8331
> URL: https://issues.apache.org/jira/browse/BEAM-8331
> Project: Beam
> Issue Type: Bug
> Components: dsl-sql
> Affects Versions: 2.15.0, 2.16.0
> Reporter: Andrew Pilloud
> Assignee: Kai Jiang
> Priority: Major
> Time Spent: 50m
> Remaining Estimate: 0h
>
> If the beam vendored calcite and a non-vendored calcite are both on the
> classpath, neither version works. This is because the non-JDBC calcite path
> uses JDBC as a easy way to perform reflection. (This affects the non-JDBC
> version of calcite.) We need to rewrite the calcite JDBC urls as part of our
> vendoring (for example 'jdbc:calcite:' to 'jdbc:beam-vendor-calcite:').
> Example of where this happens:
> [https://github.com/apache/calcite/blob/0cce229903a845a7b8ed36cf86d6078fd82d73d3/core/src/main/java/org/apache/calcite/tools/Frameworks.java#L175]
>
> {code:java}
> java.lang.RuntimeException: java.lang.RuntimeException: Property
> 'org.apache.beam.sdk.extensions.sql.impl.planner.BeamRelDataTypeSystem' not
> valid for plugin type org.apache.calcite.rel.type.RelDataTypeSystem
> at
> org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.tools.Frameworks.withPrepare(Frameworks.java:160)
> at
> org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.tools.Frameworks.withPlanner(Frameworks.java:115)
> at
> org.apache.beam.sdk.extensions.sql.zetasql.ZetaSQLPlannerImpl.<init>(ZetaSQLPlannerImpl.java:86)
> at
> org.apache.beam.sdk.extensions.sql.zetasql.ZetaSQLQueryPlanner.<init>(ZetaSQLQueryPlanner.java:55){code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)