diff --git a/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datagen/DataGeneratorRowFn.java b/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datagen/DataGeneratorRowFn.java index 6823b9e17c58..e5f720b4ced5 100644 --- a/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datagen/DataGeneratorRowFn.java +++ b/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/provider/datagen/DataGeneratorRowFn.java @@ -30,7 +30,7 @@ import org.apache.beam.sdk.transforms.DoFn; import org.apache.beam.sdk.values.Row; import org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.sql.type.SqlTypeName; -import org.apache.beam.vendor.calcite.v1_28_0.org.apache.commons.lang.RandomStringUtils; +import org.apache.beam.vendor.calcite.v1_28_0.org.apache.commons.lang3.RandomStringUtils; import org.joda.time.Duration; import org.joda.time.Instant; diff --git a/settings.gradle.kts b/settings.gradle.kts index c5a425028b33..b2ff57701ba4 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -325,6 +325,7 @@ include(":sdks:typescript") include(":sdks:typescript:container") include(":vendor:grpc-1_69_0") include(":vendor:calcite-1_28_0") +include(":vendor:calcite-1_40_0") include(":vendor:guava-32_1_2-jre") include(":website") include(":runners:google-cloud-dataflow-java:worker") diff --git a/vendor/calcite-1_40_0/build.gradle b/vendor/calcite-1_40_0/build.gradle new file mode 100644 index 000000000000..94de08b48514 --- /dev/null +++ b/vendor/calcite-1_40_0/build.gradle @@ -0,0 +1,120 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Vendored version of calcite. + * + * To upgrade: + * 1. Use mvn dependency:tree and/or https://search.maven.org/search?q=g:org.apache.calcite%20AND%20a:calcite-core + * to determine dependency tree. You may need to search for optional transitive dependencies + * and determine if they need to be added or upgraded (e.g. protobuf) + * 2. Validate built artifacts by running linkage tool + * (https://github.com/apache/beam/tree/master/vendor#how-to-validate-the-vendored-dependencies) + * and unit and integration tests in a PR. + */ + +plugins { id 'org.apache.beam.vendor-java' } + +description = "Apache Beam :: Vendored Dependencies :: Calcite 1.40.0" + +group = "org.apache.beam" +version = "0.1" + +def calcite_version = "1.40.0" +def avatica_version = "1.26.0" +def prefix = "org.apache.beam.vendor.calcite.v1_40_0" + +List packagesToRelocate = [ + "com.esri", + "com.fasterxml", + "com.google.common", + "com.google.gson", + "com.google.protobuf", + "com.google.thirdparty", + "com.google.uzaygezen", + "com.jayway", + "com.yahoo", + "net.minidev", + "org.apache.calcite", + "org.apache.commons", + "org.apache.http", + "org.apiguardian.api", + "org.codehaus", + "org.objectweb", + "org.pentaho", + "org.yaml", +] + +vendorJava( + dependencies: [ + "org.apache.calcite:calcite-core:$calcite_version", + "org.apache.calcite:calcite-linq4j:$calcite_version", + "org.apache.calcite.avatica:avatica-core:$avatica_version", + ], + runtimeDependencies: [ + library.java.slf4j_api, + ], + relocations: packagesToRelocate.collectEntries { + [ (it): "${prefix}.${it}" ] + [ "jdbc:calcite:": "jdbc:beam-vendor-calcite:"] + }, + exclusions: [ + // Code quality / Building annotations + "com/google/errorprone/**", + "com/google/j2objc/annotations/**", + "javax/annotation/**", + "org/checkerframework/**", + "org/jmlspecs/**", + "org/intellij/lang/annotations/**", + "org/jetbrains/annotations/**", + + // Runtime logging interface + "org/slf4j/**", + "org/apache/log4j/**", + "org/apache/logging/log4j/**", + "META-INF/versions/9/org/apache/logging/log4j/**", + + // Optional loggers + "org/apache/commons/logging/impl/AvalonLogger*", + "org/apache/commons/logging/impl/LogKitLogger*", + + // Optional JSON providers + "com/jayway/jsonpath/spi/json/GsonJsonProvider*", + "com/jayway/jsonpath/spi/json/JettisonProvider*", + "com/jayway/jsonpath/spi/json/JsonOrgJsonProvider*", + "com/jayway/jsonpath/spi/json/TapestryJsonProvider*", + "com/jayway/jsonpath/spi/mapper/GsonMappingProvider*", + "com/jayway/jsonpath/spi/mapper/JsonOrgMappingProvider*", + "com/jayway/jsonpath/spi/mapper/TapestryMappingProvider*", + + // Unused broken code + "org/apache/commons/dbcp2/managed/**", + "org/apache/commons/pool2/proxy/**", + "org/codehaus/janino/AntCompilerAdapter*", + + // Optional kotlin code + "kotlin/**", + + // maven poms + "META-INF/maven/**", + + "**/module-info.class", + ], + groupId: group, + artifactId: "beam-vendor-calcite-1_40_0", + version: version, +)