Class IcebergUtils

java.lang.Object
org.apache.beam.sdk.io.iceberg.IcebergUtils

public class IcebergUtils extends Object
Utilities for converting between Beam and Iceberg types, made public for user's convenience.
  • Method Details

    • icebergSchemaToBeamSchema

      public static Schema icebergSchemaToBeamSchema(org.apache.iceberg.Schema schema)
      Converts an Iceberg Schema to a Beam Schema.
    • icebergSchemaToBeamSchema

      public static Schema icebergSchemaToBeamSchema(org.apache.iceberg.Schema schema, @Nullable String updateCompatibilityVersion)
      Converts an Iceberg Schema to a Beam Schema, accounting for update compatibility.
    • beamSchemaToIcebergSchema

      public static org.apache.iceberg.Schema beamSchemaToIcebergSchema(Schema schema)
      Converts a Beam Schema to an Iceberg Schema.

      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 Beam Row to an Iceberg Record.
    • structToRow

      public static Row structToRow(Schema schema, org.apache.iceberg.StructLike struct)
      Converts a StructLike to a Beam Row.
    • icebergRecordToBeamRow

      public static Row icebergRecordToBeamRow(Schema schema, org.apache.iceberg.data.Record record)
      Converts an Iceberg Record to a Beam Row.
    • 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

      public static org.apache.iceberg.catalog.TableIdentifier parseTableIdentifier(String table)
      Parses either Iceberg's JSON table identifier representation or the legacy dotted form.