Skip to content

Commit c0531cb

Browse files
committed
exclude fields from identifier fields
1 parent 5de4d25 commit c0531cb

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

airbyte-cdk/bulk/toolkits/load-iceberg-parquet/src/main/kotlin/io/airbyte/cdk/load/data/iceberg/parquet/AirbyteTypeToIcebergSchema.kt

+10-2
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,23 @@ fun ObjectType.toIcebergSchema(primaryKeys: List<List<String>>): Schema {
107107
// There's no _airbyte_data field, because we flatten the fields.
108108
// But we should leave the _airbyte_meta field as an actual object.
109109
val stringifyObjects = name != Meta.COLUMN_NAME_AB_META
110+
val icebergType =
111+
icebergTypeConverter.convert(field.type, stringifyObjects = stringifyObjects)
110112
fields.add(
111113
NestedField.of(
112114
id,
113115
isOptional,
114116
name,
115-
icebergTypeConverter.convert(field.type, stringifyObjects = stringifyObjects),
117+
icebergType,
116118
),
117119
)
118-
if (isPrimaryKey) {
120+
// Identifier fields must be primitive types, and cannot be float/double.
121+
if (
122+
isPrimaryKey &&
123+
icebergType.isPrimitiveType &&
124+
icebergType != Types.DoubleType.get() &&
125+
icebergType != Types.FloatType.get()
126+
) {
119127
identifierFields.add(id)
120128
}
121129
}

airbyte-integrations/connectors/destination-s3-data-lake/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins {
66
airbyteBulkConnector {
77
core = 'load'
88
toolkits = ['load-iceberg-parquet', 'load-aws']
9-
cdk = '0.334'
9+
cdk = 'local'
1010
}
1111

1212
application {

0 commit comments

Comments
 (0)