blob: a0de04ed8544a975a76f5af9909cb80ee8d63d6e [file]
/*
* 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.
*/
import groovy.json.JsonOutput
plugins { id 'org.apache.beam.module' }
applyJavaNature(
automaticModuleName: 'org.apache.beam.sdk.io.delta',
// Latest version of the Delta Kernel API requires Java 17.
requireJavaVersion: JavaVersion.VERSION_17,
)
description = "Apache Beam :: SDKs :: Java :: IO :: Delta Lake"
ext.summary = "Integration with Delta Lake."
// We need to override the GCS bigdataos connector version to prevent conflicts.
def bigdataoss_gcs_connector_version = "4.0.4"
def parquet_version = "1.16.0"
dependencies {
implementation project(path: ":sdks:java:core", configuration: "shadow")
implementation project(path: ":model:pipeline", configuration: "shadow")
implementation library.java.delta_kernel_api
implementation library.java.delta_kernel_defaults
permitUnusedDeclared library.java.delta_kernel_api
permitUnusedDeclared library.java.delta_kernel_defaults
implementation library.java.hadoop_common
implementation library.java.joda_time
// implementation library.java.slf4j_api
implementation "org.apache.parquet:parquet-column:$parquet_version"
implementation "org.apache.parquet:parquet-hadoop:$parquet_version"
// We need to override the GCS connector version to prevent conflicts with
// latest Hadoop.
implementation "com.google.cloud.bigdataoss:gcs-connector:$bigdataoss_gcs_connector_version"
implementation "com.google.cloud.bigdataoss:util-hadoop:$bigdataoss_gcs_connector_version"
implementation "com.google.cloud.bigdataoss:gcsio:$bigdataoss_gcs_connector_version"
implementation "com.google.cloud.bigdataoss:util:$bigdataoss_gcs_connector_version"
permitUnusedDeclared "com.google.cloud.bigdataoss:gcs-connector:$bigdataoss_gcs_connector_version"
permitUnusedDeclared "com.google.cloud.bigdataoss:util-hadoop:$bigdataoss_gcs_connector_version"
permitUnusedDeclared "com.google.cloud.bigdataoss:gcsio:$bigdataoss_gcs_connector_version"
permitUnusedDeclared "com.google.cloud.bigdataoss:util:$bigdataoss_gcs_connector_version"
runtimeOnly library.java.hadoop_aws
// For Avro conversions
testImplementation project(":sdks:java:extensions:avro")
testImplementation library.java.avro
testImplementation library.java.junit
testImplementation library.java.hamcrest
testImplementation "org.apache.parquet:parquet-avro:$parquet_version"
testImplementation project(":sdks:java:io:parquet")
testImplementation project(":sdks:java:managed")
testRuntimeOnly "org.yaml:snakeyaml:2.0"
testImplementation project(path: ":runners:direct-java", configuration: "shadow")
testImplementation project(":sdks:java:io:google-cloud-platform")
testImplementation project(":sdks:java:extensions:google-cloud-platform-core")
testImplementation library.java.google_cloud_storage
testImplementation library.java.testcontainers_base
testImplementation library.java.testcontainers_localstack
testImplementation library.java.hadoop_aws
testRuntimeOnly project(path: ":runners:google-cloud-dataflow-java")
testRuntimeOnly library.java.slf4j_simple
}
configurations.all {
// Exclude conflicting logging frameworks
exclude group: "org.apache.logging.log4j", module: "log4j-slf4j2-impl"
exclude group: "org.apache.logging.log4j", module: "log4j-slf4j-impl"
exclude group: "org.slf4j", module: "slf4j-reload4j"
// Force overriding for all configurations
resolutionStrategy.force "com.google.cloud.bigdataoss:gcs-connector:$bigdataoss_gcs_connector_version"
resolutionStrategy.force "com.google.cloud.bigdataoss:util-hadoop:$bigdataoss_gcs_connector_version"
resolutionStrategy.force "com.google.cloud.bigdataoss:gcsio:$bigdataoss_gcs_connector_version"
resolutionStrategy.force "com.google.cloud.bigdataoss:util:$bigdataoss_gcs_connector_version"
}
def gcpProject = project.findProperty('gcpProject') ?: 'apache-beam-testing'
def gcpTempLocation = project.findProperty('gcpTempLocation') ?: 'gs://apache-beam-testing-delta-lake/temp'
// Used by Dataflow integration tests.
task dataflowIntegrationTest(type: Test) {
group = "Verification"
evaluationDependsOn(":runners:google-cloud-dataflow-java")
dependsOn ":runners:google-cloud-dataflow-java:buildAndPushDockerJavaContainer"
finalizedBy ":runners:google-cloud-dataflow-java:cleanUpDockerJavaImages"
def dockerJavaImageName = project.project(':runners:google-cloud-dataflow-java').ext.dockerJavaImageName
def args = [
"--runner=TestDataflowRunner",
"--region=us-central1",
"--project=${gcpProject}",
"--tempLocation=${gcpTempLocation}",
"--tempRoot=${gcpTempLocation}",
"--sdkContainerImage=${dockerJavaImageName}",
"--experiments=use_runner_v2,use_staged_dataflow_worker_jar"
]
systemProperty "beamTestPipelineOptions", JsonOutput.toJson(args)
// Disable Gradle cache: these ITs interact with live service that should always be considered "out of date"
outputs.upToDateWhen { false }
include '**/*IT.class'
exclude '**/DeltaIOS3IT.class'
maxParallelForks 4
classpath = sourceSets.test.runtimeClasspath
testClassesDirs = sourceSets.test.output.classesDirs
}
task integrationTest(type: Test) {
group = "Verification"
description = "Runs integration tests locally."
outputs.upToDateWhen { false }
include '**/*IT.class'
classpath = sourceSets.test.runtimeClasspath
testClassesDirs = sourceSets.test.output.classesDirs
systemProperty "org.slf4j.simpleLogger.log.org.apache.hadoop.fs.s3a", "info"
systemProperty "org.slf4j.simpleLogger.log.software.amazon.awssdk", "info"
}