Class IcebergUtil

java.lang.Object
io.trino.plugin.iceberg.IcebergUtil

public final class IcebergUtil extends Object
  • Field Details

  • Method Details

    • isIcebergTable

      public static boolean isIcebergTable(Table table)
    • loadIcebergTable

      public static org.apache.iceberg.Table loadIcebergTable(TrinoCatalog catalog, IcebergTableOperationsProvider tableOperationsProvider, ConnectorSession session, SchemaTableName table)
    • getIcebergTableWithMetadata

      public static org.apache.iceberg.Table getIcebergTableWithMetadata(TrinoCatalog catalog, IcebergTableOperationsProvider tableOperationsProvider, ConnectorSession session, SchemaTableName table, org.apache.iceberg.TableMetadata tableMetadata)
    • getIcebergTableProperties

      public static Map<String,Object> getIcebergTableProperties(org.apache.iceberg.Table icebergTable)
    • getColumns

      public static List<IcebergColumnHandle> getColumns(org.apache.iceberg.Schema schema, TypeManager typeManager)
    • getColumnHandle

      public static IcebergColumnHandle getColumnHandle(org.apache.iceberg.types.Types.NestedField column, TypeManager typeManager)
    • schemaFromHandles

      public static org.apache.iceberg.Schema schemaFromHandles(List<IcebergColumnHandle> columns)
    • getIdentityPartitions

      public static Map<org.apache.iceberg.PartitionField,Integer> getIdentityPartitions(org.apache.iceberg.PartitionSpec partitionSpec)
    • primitiveFieldTypes

      public static Map<Integer,org.apache.iceberg.types.Type.PrimitiveType> primitiveFieldTypes(org.apache.iceberg.Schema schema)
    • getFileFormat

      public static IcebergFileFormat getFileFormat(org.apache.iceberg.Table table)
    • getFileFormat

      public static IcebergFileFormat getFileFormat(Map<String,String> storageProperties)
    • getTableComment

      public static Optional<String> getTableComment(org.apache.iceberg.Table table)
    • quotedTableName

      public static String quotedTableName(SchemaTableName name)
    • canEnforceColumnConstraintInSpecs

      public static boolean canEnforceColumnConstraintInSpecs(TypeOperators typeOperators, org.apache.iceberg.Table table, Set<Integer> partitionSpecIds, IcebergColumnHandle columnHandle, Domain domain)
    • deserializePartitionValue

      public static Object deserializePartitionValue(Type type, String valueString, String name)
    • getPartitionKeys

      public static Map<Integer,Optional<String>> getPartitionKeys(org.apache.iceberg.FileScanTask scanTask)
      Returns a map from fieldId to serialized partition value containing entries for all identity partitions. null partition values are represented with Optional.empty().
    • getPartitionKeys

      public static Map<Integer,Optional<String>> getPartitionKeys(org.apache.iceberg.StructLike partition, org.apache.iceberg.PartitionSpec spec)
    • getLocationProvider

      public static org.apache.iceberg.io.LocationProvider getLocationProvider(SchemaTableName schemaTableName, String tableLocation, Map<String,String> storageProperties)
    • schemaFromMetadata

      public static org.apache.iceberg.Schema schemaFromMetadata(List<ColumnMetadata> columns)
    • newCreateTableTransaction

      public static org.apache.iceberg.Transaction newCreateTableTransaction(TrinoCatalog catalog, ConnectorTableMetadata tableMetadata, ConnectorSession session)
    • getSnapshotIdAsOfTime

      public static long getSnapshotIdAsOfTime(org.apache.iceberg.Table table, long epochMillis)
    • validateTableCanBeDropped

      public static void validateTableCanBeDropped(org.apache.iceberg.Table table)
    • parseVersion

      public static OptionalInt parseVersion(String metadataLocation) throws TrinoException
      Throws:
      TrinoException
    • fixBrokenMetadataLocation

      public static String fixBrokenMetadataLocation(String location)
    • fileName

      public static String fileName(String path)
    • commit

      public static void commit(org.apache.iceberg.SnapshotUpdate<?> update, ConnectorSession session)