This is an automated email from the ASF dual-hosted git repository. jhyde pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/calcite.git
commit 6208196d1239d77e2f30329e58b9ac13b4b199be Author: Julian Hyde <[email protected]> AuthorDate: Fri Dec 17 01:10:21 2021 -0800 Finishing up [CALCITE-4937], remove workarounds for [CALCITE-4877] --- .../src/main/java/org/apache/calcite/util/Bug.java | 29 ---------------------- server/src/test/resources/sql/schema.iq | 7 ------ .../java/org/apache/calcite/test/QuidemTest.java | 2 -- 3 files changed, 38 deletions(-) diff --git a/core/src/main/java/org/apache/calcite/util/Bug.java b/core/src/main/java/org/apache/calcite/util/Bug.java index 61df590..b9d44d8 100644 --- a/core/src/main/java/org/apache/calcite/util/Bug.java +++ b/core/src/main/java/org/apache/calcite/util/Bug.java @@ -16,10 +16,6 @@ */ package org.apache.calcite.util; -import org.apache.calcite.avatica.AvaticaUtils; - -import java.util.Objects; - /** * Holder for a list of constants describing which bugs which have not been * fixed. @@ -205,14 +201,6 @@ public abstract class Bug { * fixed. */ public static final boolean CALCITE_4213_FIXED = false; - /** Whether - * <a href="https://issues.apache.org/jira/browse/CALCITE-4877">[CALCITE-4877] - * Make the exception information of class not found more explicit</a> is - * fixed. The actual fix is in Avatica, and we don't know the precise version - * of Avatica, so we have to deduce whether it is fixed from Avatica's - * behavior. We memoize the result so that we don't generate lots of exceptions. */ - public static final boolean CALCITE_4877_FIXED = isCalcite4877Fixed(); - /** * Use this to flag temporary code. */ @@ -250,21 +238,4 @@ public abstract class Bug { return false; } - private static boolean isCalcite4877Fixed() { - try { - AvaticaUtils.instantiatePlugin(Integer.class, - "org.apache.calcite.NonExistent"); - } catch (RuntimeException e) { - // Avatica 1.19 and earlier gives - // Property 'org.apache.calcite.NonExistent' not valid for plugin type - // java.lang.Integer - // Avatica 1.20 and later gives - // Property 'org.apache.calcite.NonExistent' not valid as - // 'org.apache.calcite.NonExistent' not found in the classpath - return Objects.equals(e.getMessage(), - "Property 'org.apache.calcite.NonExistent' not valid as " - + "'org.apache.calcite.NonExistent' not found in the classpath"); - } - return false; - } } diff --git a/server/src/test/resources/sql/schema.iq b/server/src/test/resources/sql/schema.iq index 9a91c97..a2a5d50 100755 --- a/server/src/test/resources/sql/schema.iq +++ b/server/src/test/resources/sql/schema.iq @@ -65,16 +65,9 @@ create schema if not exists s; !update # Bad library -!if (fixed.calcite4877) { create foreign schema fs library 'com.example.BadSchemaFactory'; Property 'com.example.BadSchemaFactory' not valid as 'com.example.BadSchemaFactory' not found in the classpath !error -!} -!if (not.fixed.calcite4877) { -create foreign schema fs library 'com.example.BadSchemaFactory'; -Property 'com.example.BadSchemaFactory' not valid for plugin type org.apache.calcite.schema.SchemaFactory -!error -!} # Bad type create foreign schema fs type 'bad'; diff --git a/testkit/src/main/java/org/apache/calcite/test/QuidemTest.java b/testkit/src/main/java/org/apache/calcite/test/QuidemTest.java index fe09872..6c88920 100644 --- a/testkit/src/main/java/org/apache/calcite/test/QuidemTest.java +++ b/testkit/src/main/java/org/apache/calcite/test/QuidemTest.java @@ -79,8 +79,6 @@ public abstract class QuidemTest { return Bug.CALCITE_1045_FIXED; case "calcite1048": return Bug.CALCITE_1048_FIXED; - case "calcite4877": - return Bug.CALCITE_4877_FIXED; } return null; };
