Package org.apache.beam.sdk.io.iceberg
Class IcebergUtils
java.lang.Object
org.apache.beam.sdk.io.iceberg.IcebergUtils
Utilities for converting between Beam and Iceberg types, made public for user's convenience.
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.iceberg.data.RecordbeamRowToIcebergRecord(org.apache.iceberg.Schema schema, Row row) Converts a BeamRowto an IcebergRecord.static org.apache.iceberg.SchemabeamSchemaToIcebergSchema(Schema schema) Converts a BeamSchemato an IcebergSchema.static RowicebergRecordToBeamRow(Schema schema, org.apache.iceberg.data.Record record) Converts an IcebergRecordto a BeamRow.static SchemaicebergSchemaToBeamSchema(org.apache.iceberg.Schema schema) Converts an IcebergSchemato a BeamSchema.static SchemaicebergSchemaToBeamSchema(org.apache.iceberg.Schema schema, @Nullable String updateCompatibilityVersion) Converts an IcebergSchemato a BeamSchema, accounting for update compatibility.static org.apache.iceberg.catalog.TableIdentifierparseTableIdentifier(String table) Parses either Iceberg's JSON table identifier representation or the legacy dotted form.static RowstructToRow(Schema schema, org.apache.iceberg.StructLike struct) Converts aStructLiketo a BeamRow.static StringtableIdentifierToString(org.apache.iceberg.catalog.TableIdentifier tableIdentifier) Serializes a table identifier without losing dots or other special characters in each part.
-
Method Details
-
icebergSchemaToBeamSchema
Converts an IcebergSchemato a BeamSchema. -
icebergSchemaToBeamSchema
public static Schema icebergSchemaToBeamSchema(org.apache.iceberg.Schema schema, @Nullable String updateCompatibilityVersion) Converts an IcebergSchemato a BeamSchema, accounting for update compatibility. -
beamSchemaToIcebergSchema
Converts a BeamSchemato an IcebergSchema.The following unsupported Beam types will be defaulted to
Types.StringType:invalid reference
Schema.TypeName.DECIMAL -
beamRowToIcebergRecord
public static org.apache.iceberg.data.Record beamRowToIcebergRecord(org.apache.iceberg.Schema schema, Row row) Converts a BeamRowto an IcebergRecord. -
structToRow
Converts aStructLiketo a BeamRow. -
icebergRecordToBeamRow
Converts an IcebergRecordto a BeamRow. -
tableIdentifierToString
public static String tableIdentifierToString(org.apache.iceberg.catalog.TableIdentifier tableIdentifier) Serializes a table identifier without losing dots or other special characters in each part. -
parseTableIdentifier
Parses either Iceberg's JSON table identifier representation or the legacy dotted form.
-