DRILL-8304: Update Calcite to 1.32.0 (#2647)
diff --git a/contrib/storage-cassandra/pom.xml b/contrib/storage-cassandra/pom.xml
index 972ccb5..9bc24f6 100644
--- a/contrib/storage-cassandra/pom.xml
+++ b/contrib/storage-cassandra/pom.xml
@@ -43,12 +43,8 @@
<version>${calcite.version}</version>
<exclusions>
<exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- <exclusion>
<groupId>com.datastax.oss</groupId>
- <artifactId>cassandra-driver-core</artifactId>
+ <artifactId>java-driver-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.calcite.avatica</groupId>
diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/compile/JaninoClassCompiler.java b/exec/java-exec/src/main/java/org/apache/drill/exec/compile/JaninoClassCompiler.java
index 787d681..2a7ab66 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/compile/JaninoClassCompiler.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/compile/JaninoClassCompiler.java
@@ -19,7 +19,8 @@
import java.io.IOException;
import java.io.StringReader;
-import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@@ -46,11 +47,11 @@
@Override
protected byte[][] getByteCode(final ClassNames className, final String sourceCode)
throws CompileException, IOException {
- ClassFile[] classFiles = doCompile(sourceCode);
+ List<ClassFile> classFiles = doCompile(sourceCode);
- byte[][] byteCodes = new byte[classFiles.length][];
- for(int i = 0; i < classFiles.length; i++){
- byteCodes[i] = classFiles[i].toByteArray();
+ byte[][] byteCodes = new byte[classFiles.size()][];
+ for(int i = 0; i < classFiles.size(); i++){
+ byteCodes[i] = classFiles.get(i).toByteArray();
}
return byteCodes;
}
@@ -59,18 +60,19 @@
public Map<String,byte[]> compile(final ClassNames className, final String sourceCode)
throws CompileException, IOException, ClassNotFoundException {
- ClassFile[] classFiles = doCompile(sourceCode);
- return Arrays.stream(classFiles)
+ return doCompile(sourceCode).stream()
.collect(Collectors.toMap(ClassFile::getThisClassName, ClassFile::toByteArray, (a, b) -> b));
}
- private ClassFile[] doCompile(final String sourceCode)
+ private List<ClassFile> doCompile(final String sourceCode)
throws CompileException, IOException {
StringReader reader = new StringReader(sourceCode);
Scanner scanner = new Scanner(null, reader);
Java.AbstractCompilationUnit compilationUnit = new Parser(scanner).parseAbstractCompilationUnit();
- return new UnitCompiler(compilationUnit, compilationClassLoader)
- .compileUnit(this.debug, this.debug, this.debug);
+ List<ClassFile> classFiles = new ArrayList<>();
+ new UnitCompiler(compilationUnit, compilationClassLoader)
+ .compileUnit(this.debug, this.debug, this.debug, classFiles);
+ return classFiles;
}
@Override
diff --git a/pom.xml b/pom.xml
index dc8c45a..512de04 100644
--- a/pom.xml
+++ b/pom.xml
@@ -55,9 +55,9 @@
<parquet.version>1.12.2</parquet.version>
<parquet.format.version>2.8.0</parquet.format.version>
<calcite.groupId>org.apache.calcite</calcite.groupId>
- <calcite.version>1.31.0</calcite.version>
+ <calcite.version>1.32.0</calcite.version>
<avatica.version>1.22.0</avatica.version>
- <janino.version>3.1.7</janino.version>
+ <janino.version>3.1.8</janino.version>
<sqlline.version>1.12.0</sqlline.version>
<jackson.version>2.13.2.20220328</jackson.version>
<zookeeper.version>3.5.7</zookeeper.version>