Skip to content

Commit

Permalink
[BEAM-9379] Update to vendored Calcite to 1.26.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsbasjes authored and apilloud committed Sep 2, 2021
1 parent aca8816 commit 3a3dd5b
Show file tree
Hide file tree
Showing 53 changed files with 521 additions and 352 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ runners/**/vendor/**/*
**/.gradletasknamecache
**/generated/*

# Ignore sources generated into the main tree
**/src/main/generated/**
**/src/test/generated_tests/**

# Ignore files generated by the Maven build process.
**/bin/**/*
**/dependency-reduced-pom.xml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ class BeamModulePlugin implements Plugin<Project> {
vendored_bytebuddy_1_11_0 : "org.apache.beam:beam-vendor-bytebuddy-1_11_0:0.1",
vendored_grpc_1_36_0 : "org.apache.beam:beam-vendor-grpc-1_36_0:0.2",
vendored_guava_26_0_jre : "org.apache.beam:beam-vendor-guava-26_0-jre:0.1",
vendored_calcite_1_20_0 : "org.apache.beam:beam-vendor-calcite-1_20_0:0.1",
vendored_calcite_1_26_0 : "org.apache.beam:beam-vendor-calcite-1_26_0:0.1",
woodstox_core_asl : "org.codehaus.woodstox:woodstox-core-asl:4.4.1",
zstd_jni : "com.github.luben:zstd-jni:1.4.5-2",
quickcheck_core : "com.pholser:junit-quickcheck-core:$quickcheck_version",
Expand Down
10 changes: 5 additions & 5 deletions sdks/java/extensions/sql/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ dependencies {
javacc "net.java.dev.javacc:javacc:4.0"
fmppTask "com.googlecode.fmpp-maven-plugin:fmpp-maven-plugin:1.0"
fmppTask "org.freemarker:freemarker:2.3.31"
fmppTemplates library.java.vendored_calcite_1_20_0
fmppTemplates library.java.vendored_calcite_1_26_0
compile project(path: ":sdks:java:core", configuration: "shadow")
compile project(":sdks:java:extensions:join-library")
permitUnusedDeclared project(":sdks:java:extensions:join-library") // BEAM-11761
Expand All @@ -66,7 +66,7 @@ dependencies {
compile library.java.commons_csv
compile library.java.jackson_databind
compile library.java.joda_time
compile library.java.vendored_calcite_1_20_0
compile library.java.vendored_calcite_1_26_0
compile "com.alibaba:fastjson:1.2.69"
compile "org.codehaus.janino:janino:3.0.11"
compile "org.codehaus.janino:commons-compiler:3.0.11"
Expand All @@ -83,7 +83,7 @@ dependencies {
provided library.java.jackson_dataformat_xml
provided library.java.hadoop_client
provided library.java.kafka_clients
testCompile library.java.vendored_calcite_1_20_0
testCompile library.java.vendored_calcite_1_26_0
testCompile library.java.vendored_guava_26_0_jre
testCompile library.java.junit
testCompile library.java.quickcheck_core
Expand Down Expand Up @@ -123,11 +123,11 @@ task copyFmppTemplatesFromCalciteCore(type: Copy) {
into "${project.buildDir}/templates-fmpp"
filter{
line ->
line.replace('import org.apache.calcite.', 'import org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.')
line.replace('import org.apache.calcite.', 'import org.apache.beam.vendor.calcite.v1_26_0.org.apache.calcite.')
}
filter{
line ->
line.replace('import static org.apache.calcite.', 'import static org.apache.beam.vendor.calcite.v1_20_0.org.apache.calcite.')
line.replace('import static org.apache.calcite.', 'import static org.apache.beam.vendor.calcite.v1_26_0.org.apache.calcite.')
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
import static org.apache.beam.sdk.extensions.sql.jdbc.BeamSqlLineTestingUtils.toLines;
import static org.hamcrest.CoreMatchers.everyItem;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.oneOf;

import java.io.ByteArrayOutputStream;
import java.io.File;
import java.util.Arrays;
import java.util.List;
import org.hamcrest.collection.IsIn;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
Expand Down Expand Up @@ -94,7 +95,7 @@ public void testSqlLine_select() throws Exception {
List<List<String>> lines = toLines(byteArrayOutputStream);
assertThat(
Arrays.asList(Arrays.asList("3", "hello", "2018-05-28")),
everyItem(IsIn.isOneOf(lines.toArray())));
everyItem(is(oneOf(lines.toArray()))));
}

@Test
Expand All @@ -114,7 +115,7 @@ public void testSqlLine_selectFromTable() throws Exception {
Arrays.asList(
Arrays.asList("col_a", "col_b", "col_c", "col_x", "col_y", "col_z"),
Arrays.asList("a", "b", "c", "1", "2", "3")),
everyItem(IsIn.isOneOf(lines.toArray())));
everyItem(is(oneOf(lines.toArray()))));
}

@Test
Expand All @@ -129,8 +130,7 @@ public void testSqlLine_insertSelect() throws Exception {
BeamSqlLine.runSqlLine(args, null, byteArrayOutputStream, null);

List<List<String>> lines = toLines(byteArrayOutputStream);
assertThat(
Arrays.asList(Arrays.asList("3", "hello")), everyItem(IsIn.isOneOf(lines.toArray())));
assertThat(Arrays.asList(Arrays.asList("3", "hello")), everyItem(is(oneOf(lines.toArray()))));
}

@Test
Expand All @@ -149,7 +149,7 @@ public void testSqlLine_GroupBy() throws Exception {
List<List<String>> lines = toLines(byteArrayOutputStream);
assertThat(
Arrays.asList(Arrays.asList("3", "2"), Arrays.asList("4", "1")),
everyItem(IsIn.isOneOf(lines.toArray())));
everyItem(is(oneOf(lines.toArray()))));
}

@Test
Expand All @@ -169,7 +169,7 @@ public void testSqlLine_fixedWindow() throws Exception {
assertThat(
Arrays.asList(
Arrays.asList("2018-07-01 21:26:06", "1"), Arrays.asList("2018-07-01 21:26:07", "1")),
everyItem(IsIn.isOneOf(lines.toArray())));
everyItem(is(oneOf(lines.toArray()))));
}

@Test
Expand All @@ -195,6 +195,6 @@ public void testSqlLine_slidingWindow() throws Exception {
Arrays.asList("2018-07-01 21:26:09", "2"),
Arrays.asList("2018-07-01 21:26:10", "2"),
Arrays.asList("2018-07-01 21:26:11", "1")),
everyItem(IsIn.isOneOf(lines.toArray())));
everyItem(is(oneOf(lines.toArray()))));
}
}
Loading

0 comments on commit 3a3dd5b

Please sign in to comment.