Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/trigger_files/IO_Iceberg_Integration_Tests.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"comment": "Modify this file in a trivial way to cause this test suite to run.",
"modification": 8
"modification": 2
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"comment": "Modify this file in a trivial way to cause this test suite to run.",
"modification": 1,
"https://github.com/apache/beam/pull/39990": "removing dead code from FnApiDoFnRunner"
"modification": 1
}
17 changes: 17 additions & 0 deletions sdks/java/io/iceberg/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ dependencies {
testImplementation project(path: ":runners:direct-java", configuration: "shadow")
testRuntimeOnly project(path: ":runners:google-cloud-dataflow-java")
testRuntimeOnly project(path: ":sdks:java:harness")
testImplementation(project(path: ":sdks:java:io:delta", configuration: "testRuntimeMigration")) {
exclude group: "org.apache.hadoop", module: "hadoop-aws"
exclude group: "org.testcontainers"
exclude group: "org.slf4j", module: "slf4j-simple"
}
hadoopVersions.each {kv ->
"hadoopVersion$kv.key" "org.apache.hadoop:hadoop-client:$kv.value"
"hadoopVersion$kv.key" "org.apache.hadoop:hadoop-minicluster:$kv.value"
Expand All @@ -130,6 +135,9 @@ configurations.all {
resolutionStrategy.force 'org.apache.hadoop:hadoop-client:3.3.6'
resolutionStrategy.force 'org.apache.hadoop:hadoop-hdfs:3.3.6'
resolutionStrategy.force 'org.apache.hadoop:hadoop-hdfs-client:3.3.6'
// Delta Kernel (test only) needs the shaded client jars; keep them on the same Hadoop line.
resolutionStrategy.force 'org.apache.hadoop:hadoop-client-api:3.3.6'
resolutionStrategy.force 'org.apache.hadoop:hadoop-client-runtime:3.3.6'
}

hadoopVersions.each {kv ->
Expand Down Expand Up @@ -200,9 +208,11 @@ task integrationTest(type: Test) {
task dataflowIntegrationTest(type: Test) {
group = "Verification"
evaluationDependsOn(":runners:google-cloud-dataflow-java")
dependsOn ":runners:google-cloud-dataflow-java:worker:shadowJar"
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 dataflowLegacyWorkerJar = project.project(":runners:google-cloud-dataflow-java:worker").shadowJar.archivePath

def args = [
"--runner=DataflowRunner",
Expand All @@ -211,6 +221,7 @@ task dataflowIntegrationTest(type: Test) {
"--tempLocation=${gcpTempLocation}",
"--tempRoot=${gcpTempLocation}",
"--sdkContainerImage=${dockerJavaImageName}",
"--dataflowWorkerJar=${dataflowLegacyWorkerJar}",
"--experiments=use_runner_v2,use_staged_dataflow_worker_jar"
]
if (project.hasProperty('enableManagedTransforms')) {
Expand All @@ -229,6 +240,12 @@ task dataflowIntegrationTest(type: Test) {
includeTestsMatching 'org.apache.beam.sdk.io.iceberg.catalog.BigQueryMetastoreCatalogIT.testWriteRead'
includeTestsMatching 'org.apache.beam.sdk.io.iceberg.catalog.BigQueryMetastoreCatalogIT.testReadWriteStreaming'
includeTestsMatching 'org.apache.beam.sdk.io.iceberg.catalog.BigQueryMetastoreCatalogIT.testStreamToPartitionedDynamicDestinations'
// CDC sink. The native-ValueKind round trip tests run on legacy worker.
// The change-type-column tests run on Runner v2.
includeTestsMatching 'org.apache.beam.sdk.io.iceberg.catalog.LakehouseCatalogCdcWriteIT.changelogOfSinkWrittenTableRoundTripsThroughTheSource'
includeTestsMatching 'org.apache.beam.sdk.io.iceberg.catalog.LakehouseCatalogCdcWriteIT.changelogOfSinkWrittenTableRoundTripsThroughTheSourceWithChangeTypeColumn'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two tests never worked:

  • changeFeedAppliesToIcebergTableWithChangeTypeColumn

  • changelogOfSinkWrittenTableRoundTripsThroughTheSourceWithChangeTypeColumn

e.g. https://github.com/apache/beam/actions/runs/39764361133/job/119776009999

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They're passing on the regular Dataflow test suite (green)
Failing on managed service tests because the service hasn't upgraded to 2.77 yet

includeTestsMatching 'org.apache.beam.sdk.io.iceberg.cdc.sink.DeltaLakeToIcebergCdcIT.changeFeedAppliesToIcebergTable'
includeTestsMatching 'org.apache.beam.sdk.io.iceberg.cdc.sink.DeltaLakeToIcebergCdcIT.changeFeedAppliesToIcebergTableWithChangeTypeColumn'
}

doLast {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* 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.
*/
package org.apache.beam.sdk.io.iceberg.catalog;

import java.util.Map;
import org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.collect.ImmutableMap;
import org.apache.hadoop.conf.Configuration;
import org.apache.iceberg.CatalogUtil;
import org.apache.iceberg.catalog.Catalog;
import org.apache.iceberg.hadoop.HadoopCatalog;

/**
* {@link IcebergCdcWriteBaseIT} against a {@link HadoopCatalog}; mirrors {@link HadoopCatalogIT}.
*/
public class HadoopCatalogCdcWriteIT extends IcebergCdcWriteBaseIT {
@Override
public String type() {
return "hadoop";
}

@Override
public Catalog createCatalog() {
Configuration catalogHadoopConf = new Configuration();
catalogHadoopConf.set("fs.gs.project.id", OPTIONS.getProject());
catalogHadoopConf.set("fs.gs.auth.type", "APPLICATION_DEFAULT");
HadoopCatalog catalog = new HadoopCatalog();
catalog.setConf(catalogHadoopConf);
catalog.initialize(catalogName, ImmutableMap.of("warehouse", warehouse));
return catalog;
}

@Override
public Map<String, Object> managedIcebergConfig(String tableId) {
return ImmutableMap.<String, Object>builder()
.put("table", tableId)
.put(
"catalog_properties",
ImmutableMap.<String, String>builder()
.put("type", CatalogUtil.ICEBERG_CATALOG_TYPE_HADOOP)
.put("warehouse", warehouse)
.put("io-impl", ioImplFor(warehouse))
.build())
.build();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*
* 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.
*/
package org.apache.beam.sdk.io.iceberg.catalog;

import java.util.Map;
import java.util.concurrent.TimeUnit;
import org.apache.beam.sdk.io.iceberg.catalog.hiveutils.HiveMetastoreExtension;
import org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.collect.ImmutableMap;
import org.apache.hadoop.hive.conf.HiveConf;
import org.apache.hadoop.hive.metastore.api.MetaException;
import org.apache.iceberg.CatalogProperties;
import org.apache.iceberg.CatalogUtil;
import org.apache.iceberg.catalog.Catalog;
import org.apache.iceberg.hive.HiveCatalog;
import org.junit.AfterClass;
import org.junit.BeforeClass;

/**
* {@link IcebergCdcWriteBaseIT} against a {@link HiveCatalog} backed by an embedded metastore;
* mirrors {@link HiveCatalogIT}.
*/
public class HiveCatalogCdcWriteIT extends IcebergCdcWriteBaseIT {
private static HiveMetastoreExtension hiveMetastoreExtension;

@Override
public String type() {
return "hive";
}

@BeforeClass
public static void setUpClass() throws MetaException {
hiveMetastoreExtension = new HiveMetastoreExtension(warehouse(HiveCatalogCdcWriteIT.class));
}

@AfterClass
public static void tearDown() throws Exception {
if (hiveMetastoreExtension != null) {
hiveMetastoreExtension.cleanup();
}
}

@Override
public Catalog createCatalog() {
return CatalogUtil.loadCatalog(
HiveCatalog.class.getName(),
catalogName,
ImmutableMap.of(
CatalogProperties.CLIENT_POOL_CACHE_EVICTION_INTERVAL_MS,
String.valueOf(TimeUnit.SECONDS.toMillis(10))),
hiveMetastoreExtension.hiveConf());
}

@Override
public Map<String, Object> managedIcebergConfig(String tableId) {
String metastoreUri = hiveMetastoreExtension.hiveConf().getVar(HiveConf.ConfVars.METASTOREURIS);
Map<String, String> confProperties =
ImmutableMap.<String, String>builder()
.put(HiveConf.ConfVars.METASTOREURIS.varname, metastoreUri)
.put(HiveConf.ConfVars.METASTOREWAREHOUSE.varname, warehouse)
.build();
return ImmutableMap.<String, Object>builder()
.put("table", tableId)
.put("catalog_name", "hive_" + catalogName)
.put("catalog_properties", ImmutableMap.of("io-impl", ioImplFor(warehouse)))
.put("config_properties", confProperties)
.build();
}
}
Loading
Loading