Skip to content

Commit

Permalink
Finishing up [CALCITE-4937], remove workarounds for [CALCITE-4877]
Browse files Browse the repository at this point in the history
  • Loading branch information
julianhyde committed Dec 18, 2021
1 parent 607c45b commit 6208196
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 38 deletions.
29 changes: 0 additions & 29 deletions core/src/main/java/org/apache/calcite/util/Bug.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
*/
Expand Down Expand Up @@ -250,21 +238,4 @@ public static boolean upgrade(String remark) {
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;
}
}
7 changes: 0 additions & 7 deletions server/src/test/resources/sql/schema.iq
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 0 additions & 2 deletions testkit/src/main/java/org/apache/calcite/test/QuidemTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ private static Object getEnv(String varName) {
return Bug.CALCITE_1045_FIXED;
case "calcite1048":
return Bug.CALCITE_1048_FIXED;
case "calcite4877":
return Bug.CALCITE_4877_FIXED;
}
return null;
};
Expand Down

0 comments on commit 6208196

Please sign in to comment.