This is an automated email from the ASF dual-hosted git repository. cgivre pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/drill.git
The following commit(s) were added to refs/heads/master by this push: new e686889726 DRILL-8304: Update Calcite to 1.32.0 (#2647) e686889726 is described below commit e68688972698bed08b178c65985ce48e1b878fe7 Author: Volodymyr Vysotskyi <vvo...@gmail.com> AuthorDate: Sun Sep 11 07:17:06 2022 +0300 DRILL-8304: Update Calcite to 1.32.0 (#2647) --- contrib/storage-cassandra/pom.xml | 6 +----- .../drill/exec/compile/JaninoClassCompiler.java | 22 ++++++++++++---------- pom.xml | 4 ++-- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/contrib/storage-cassandra/pom.xml b/contrib/storage-cassandra/pom.xml index 972ccb5c56..9bc24f6fe8 100644 --- a/contrib/storage-cassandra/pom.xml +++ b/contrib/storage-cassandra/pom.xml @@ -42,13 +42,9 @@ <artifactId>calcite-cassandra</artifactId> <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 787d681ac4..2a7ab662cb 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 @@ package org.apache.drill.exec.compile; 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 @@ class JaninoClassCompiler extends AbstractClassCompiler { @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 @@ class JaninoClassCompiler extends AbstractClassCompiler { 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 dc8c45a352..512de04338 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>