InferenceResolver
The InferenceResolver class provides a consolidated set of inference options for use in LoadTableOptions. This class is most useful when the caller does not know the structure of the table being loaded, and thus wants the resultant table definition to be inferred from the Iceberg table schema.
Constructors
The InferenceResolver class is constructed from its builder:
import io.deephaven.iceberg.util.InferenceResolver
resolver = InferenceResolver.builder()
.failOnUnsupportedTypes(failOnUnsupportedTypes)
.inferPartitioningColumns(inferPartitioningColumns)
.namerFactory(namerFactory)
.schema(schema)
.build()
failOnUnsupportedTypes: Whether to fail if unsupported data types are encountered during inference.inferPartitioningColumns: Whether to infer partitioning columns from the Iceberg table.namerFactory: Theio.deephaven.iceberg.util.InferenceInstructions.Namer.Factoryto use for naming columns.schema: Theio.deephaven.iceberg.util.SchemaProviderto use when extracting the schema from the Iceberg table.
Methods
walk: Walk the resolver with the specified visitor.
Examples
The following example builds an InferenceResolver that infers partitioning columns when loading an Iceberg table into Deephaven:
import io.deephaven.iceberg.util.InferenceResolver
resolver = InferenceResolver.builder()
.inferPartitioningColumns(true)
.build()
The following example builds an InferenceResolver that fails if unsupported data types are encountered when loading an Iceberg table into Deephaven:
import io.deephaven.iceberg.util.InferenceResolver
resolver = InferenceResolver.builder()
.failOnUnsupportedTypes(true)
.build()
The following example builds an InferenceResolver that can be used to load an Iceberg table with a given schema ID:
import io.deephaven.iceberg.util.InferenceResolver
import io.deephaven.iceberg.util.SchemaProvider
resolver = InferenceResolver.builder()
.schema(SchemaProvider.fromSchemaId(123456789))
.build()
The following example builds an InferenceResolver that can be used to load an Iceberg table with a given snapshot ID:
import io.deephaven.iceberg.util.InferenceResolver
import io.deephaven.iceberg.util.SchemaProvider
resolver = InferenceResolver.builder()
.schema(SchemaProvider.fromSnapshotId(123456789))
.build()