Skip to content

Commit ee74a3e

Browse files
committed
[IcebergIO]Create tables with Iceberg Table properties
1 parent fd634ab commit ee74a3e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/IcebergWriteSchemaTransformProvider.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,9 @@ public static Builder builder() {
125125
public abstract @Nullable List<String> getPartitionFields();
126126

127127
@SchemaFieldDescription(
128-
"Iceberg table properties to be set on the table when it is created,"
129-
+ "For more information on table properties, please visit https://iceberg.apache.org/docs/latest/configuration/#table-properties.")
128+
"Iceberg table properties to be set on the table when it is created.\n"
129+
+ "For more information on table properties,"
130+
+ " please visit https://iceberg.apache.org/docs/latest/configuration/#table-properties.")
130131
public abstract @Nullable Map<String, String> getTableProperties();
131132

132133
@AutoValue.Builder

sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/RecordWriterManager.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ private Table getOrCreateTable(IcebergDestination destination, Schema dataSchema
293293
@Nullable IcebergTableCreateConfig createConfig = destination.getTableCreateConfig();
294294
PartitionSpec partitionSpec =
295295
createConfig != null ? createConfig.getPartitionSpec() : PartitionSpec.unpartitioned();
296+
// Ensure table properties are not null, Iceberg's createTable does not accept null values.
296297
Map<String, String> tableProperties =
297298
(createConfig != null && createConfig.getTableProperties() != null)
298299
? createConfig.getTableProperties()

0 commit comments

Comments
 (0)