Class IcebergUtils

java.lang.Object
io.deephaven.iceberg.base.IcebergUtils

public final class IcebergUtils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    createNamespaceIfNotExists(@NotNull org.apache.iceberg.catalog.Catalog catalog, @NotNull org.apache.iceberg.catalog.Namespace namespace)
     
    static URI
    dataFileUri(@NotNull org.apache.iceberg.Table table, @NotNull org.apache.iceberg.DataFile dataFile)
     
    static boolean
    deephavenNullOrderMatchesIceberg(@NotNull org.apache.iceberg.SortDirection direction, @NotNull org.apache.iceberg.NullOrder nullOrder)
    Whether Deephaven places nulls where nullOrder does in a sort in direction.
    static boolean
    deephavenOrderMatchesIceberg(@NotNull org.apache.iceberg.SortDirection direction, @NotNull org.apache.iceberg.NullOrder nullOrder, @NotNull Class<?> dataType, @NotNull org.apache.iceberg.types.Type icebergType)
    Whether Deephaven, sorting a column of dataType in direction, orders the column's values and nulls as the Iceberg specification orders a field of icebergType with direction and nullOrder.
    static boolean
    dropNamespaceIfExists(@NotNull org.apache.iceberg.catalog.Catalog catalog, @NotNull org.apache.iceberg.catalog.Namespace namespace)
     
    static URI
    locationUri(@NotNull org.apache.iceberg.Table table)
     
    static String
    maybeResolveRelativePath(@NotNull String path, @NotNull org.apache.iceberg.io.FileIO io)
     
    static void
    verifyPartitioningColumns(@NotNull org.apache.iceberg.PartitionSpec tablePartitionSpec, @NotNull TableDefinition tableDefinition)
    Check that all the partitioning columns from the partition spec are of supported types and are present in the Table Definition.
    static void
    verifyRequiredFields(org.apache.iceberg.Schema tableSchema, TableDefinition tableDefinition)
    Check that all required fields are present in the table definition

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • IcebergUtils

      public IcebergUtils()
  • Method Details

    • maybeResolveRelativePath

      public static String maybeResolveRelativePath(@NotNull @NotNull String path, @NotNull @NotNull org.apache.iceberg.io.FileIO io)
    • locationUri

      public static URI locationUri(@NotNull @NotNull org.apache.iceberg.Table table)
    • dataFileUri

      public static URI dataFileUri(@NotNull @NotNull org.apache.iceberg.Table table, @NotNull @NotNull org.apache.iceberg.DataFile dataFile)
    • createNamespaceIfNotExists

      public static boolean createNamespaceIfNotExists(@NotNull @NotNull org.apache.iceberg.catalog.Catalog catalog, @NotNull @NotNull org.apache.iceberg.catalog.Namespace namespace)
    • dropNamespaceIfExists

      public static boolean dropNamespaceIfExists(@NotNull @NotNull org.apache.iceberg.catalog.Catalog catalog, @NotNull @NotNull org.apache.iceberg.catalog.Namespace namespace)
    • verifyRequiredFields

      public static void verifyRequiredFields(org.apache.iceberg.Schema tableSchema, TableDefinition tableDefinition)
      Check that all required fields are present in the table definition
    • verifyPartitioningColumns

      public static void verifyPartitioningColumns(@NotNull @NotNull org.apache.iceberg.PartitionSpec tablePartitionSpec, @NotNull @NotNull TableDefinition tableDefinition)
      Check that all the partitioning columns from the partition spec are of supported types and are present in the Table Definition.
    • deephavenNullOrderMatchesIceberg

      public static boolean deephavenNullOrderMatchesIceberg(@NotNull @NotNull org.apache.iceberg.SortDirection direction, @NotNull @NotNull org.apache.iceberg.NullOrder nullOrder)
      Whether Deephaven places nulls where nullOrder does in a sort in direction. Deephaven orders null before every value, so nulls come first in an ascending sort and last in a descending one.
    • deephavenOrderMatchesIceberg

      public static boolean deephavenOrderMatchesIceberg(@NotNull @NotNull org.apache.iceberg.SortDirection direction, @NotNull @NotNull org.apache.iceberg.NullOrder nullOrder, @NotNull @NotNull Class<?> dataType, @NotNull @NotNull org.apache.iceberg.types.Type icebergType)
      Whether Deephaven, sorting a column of dataType in direction, orders the column's values and nulls as the Iceberg specification orders a field of icebergType with direction and nullOrder. Nulls must be placed as deephavenNullOrderMatchesIceberg(SortDirection, NullOrder) describes. Values are ordered alike for booleans, integers, dates, times and timestamps. Values are ordered differently for strings, which Deephaven compares by UTF-16 code unit and the specification by code point, and for floating point values, where Deephaven treats -0.0 and 0.0 as equal and orders every NaN last, but the specification orders -0.0 before 0.0 and a negative NaN first. Every other type is reported as ordered differently: Deephaven does not read the type, or the two orderings have not been compared.

      A sort field's transform is not considered: the caller decides which transforms a sort by column values honors.