Class IcebergTableOptions

java.lang.Object
io.deephaven.enterprise.iceberg.IcebergTableOptions

@Immutable public abstract class IcebergTableOptions extends Object
The options to create a Table from Iceberg.
  • Constructor Details

    • IcebergTableOptions

      public IcebergTableOptions()
  • Method Details

    • builder

      public static IcebergTableOptions.Builder builder()
      Constructs a new IcebergTableOptions.Builder.
      Returns:
      the builder
    • load

      public static IcebergTableOptions load(String namespace, String tableName)
      Loads the options from the default schema service with a TableType.SYSTEM_PERMANENT table key. The Schema must have an extended storage type of "iceberg" and have the namespace set NamespaceSet.SYSTEM.
      Parameters:
      namespace - the namespace
      tableName - the tableName
      Returns:
      the options
      See Also:
    • load

      public static IcebergTableOptions load(io.deephaven.shadow.enterprise.com.illumon.iris.db.schema.Schema schema, boolean intraday)
      Loads the options from the schema. The Schema must have an extended storage type of "iceberg" and have the namespace set SYSTEM. The tableKey() will be derived from TableDefinitionSchema.getNamespace(), TableDefinitionSchema.getTableName(), and TableDefinitionSchema.getTableTypeV2(boolean).
      Parameters:
      schema - the schema
      intraday - true if the returned type should reflect an intraday table
      Returns:
      the options
    • tableKey

      public abstract EnterpriseTableKey tableKey()
      The table key, guaranteed to be of the type TableType.SYSTEM_PERMANENT or TableType.SYSTEM_INTRADAY.
      Returns:
      the table key
    • hasDefinition

      public final boolean hasDefinition()
      Returns true if tableOptions() has a TableDefinition.
      Returns:
      if this has a definition
    • definition

      public final Optional<TableDefinition> definition()
      The TableDefinition. Will return a value when hasDefinition() is true, and empty otherwise.
      Returns:
      the definition
    • schema

      public final Optional<io.deephaven.shadow.enterprise.com.illumon.iris.db.schema.Schema> schema()
      Constructs a new SYSTEM Schema if hasDefinition() is true, and empty otherwise. The Schema will have an extended storage type of "iceberg". This does not deploy the Schema to the SchemaService.
      Returns:
      the schema
    • materialize

      public final IcebergTableOptions materialize()
      If hasDefinition() is true, will return this; otherwise, a new IcebergTableOptions with a definition will be inferred. This is useful to ensure that calling schema() on the returned value will have a result.

      When inferred, the resulting options will have the explicit IcebergTableAdapter.resolver() and functionally-equivalent IcebergTableAdapter.nameMapping() from loadTable() of this.

      Returns:
      options that has a definition
    • createAdapter

      public final IcebergCatalogAdapter createAdapter()
      Returns:
      the Iceberg catalog adapter
    • loadTable

      public final IcebergTableAdapter loadTable()
      Returns:
      the Iceberg table adapter
    • table

      public final Table table()
      Load the Table. If tableKey() has EnterpriseTableKey.getTableType() TableType.SYSTEM_INTRADAY, IcebergUpdateMode.autoRefreshingMode() will be used; otherwise, IcebergUpdateMode.staticMode() will be used.
      Returns:
      the table
      See Also:
    • table

      public final Table table(IcebergReadInstructions readInstructions)
      Load the Table with the given readInstructions.
      Parameters:
      readInstructions - the read instructions
      Returns:
      the table
    • deploy

      public final io.deephaven.shadow.enterprise.com.illumon.iris.db.schema.Schema deploy()
      Deploy the schema() to the default schema service. If the namespace does not exist, it will be created. If the Schema does not exist, it will be added; otherwise, it will be updated.

      Delegates to deploy(SchemaService) using SchemaServiceFactory.getDefault().

      Returns:
      the deployed Schema
      Throws:
      IllegalArgumentException - if hasDefinition() is false
      See Also:
    • deploy

      public final io.deephaven.shadow.enterprise.com.illumon.iris.db.schema.Schema deploy(io.deephaven.shadow.enterprise.com.illumon.iris.db.schema.SchemaService schemaService)
      Deploy the schema() to the schemaService. If the namespace does not exist, it will be created. If the Schema does not exist, it will be added; otherwise, it will be updated.
      Parameters:
      schemaService - the schema service
      Returns:
      the deployed Schema
      Throws:
      IllegalArgumentException - if hasDefinition() is false