Repository navigation
[Iceberg CDC sink] Integration tests #40230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
1dc2ac1
top api layer
ahmedabu98 6cdb24a
Merge branch 'master' of https://github.com/ahmedabu98/beam into cdc-…
ahmedabu98 ec89ca8
addreress comments
ahmedabu98 d243862
address comments
ahmedabu98 0f96bdf
spotless
ahmedabu98 488b745
update test
ahmedabu98 a88e3fc
integration tests
ahmedabu98 96d1a1d
test across hadoop, hive, lakehouse catalogs
ahmedabu98 ba2fd60
Merge branch 'master' of https://github.com/ahmedabu98/beam into cdc-…
ahmedabu98 216668a
spotless
ahmedabu98 a1606c6
add delta->iceberg IT
ahmedabu98 0311dca
Merge branch 'master' of https://github.com/ahmedabu98/beam into cdc-…
ahmedabu98 6413927
add tests with change type column; add dataflow tests
ahmedabu98 7f0812a
trigger DF ITs
ahmedabu98 55d752b
use managed api
ahmedabu98 0d948d3
remove sdkContainerImage option for legacy tests
ahmedabu98 19028a4
spotless
ahmedabu98 6d5f2a7
include worker jar dep
ahmedabu98 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| } |
3 changes: 1 addition & 2 deletions
3
.github/trigger_files/IO_Iceberg_Integration_Tests_Dataflow.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
...iceberg/src/test/java/org/apache/beam/sdk/io/iceberg/catalog/HadoopCatalogCdcWriteIT.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(); | ||
| } | ||
| } |
83 changes: 83 additions & 0 deletions
83
...o/iceberg/src/test/java/org/apache/beam/sdk/io/iceberg/catalog/HiveCatalogCdcWriteIT.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(); | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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