Package io.deephaven.iceberg.util
Class Resolver
java.lang.Object
io.deephaven.iceberg.util.Resolver
The relationship between a Deephaven
TableDefinition
and an Iceberg Schema
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
static class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Resolver.Builder
builder()
abstract Map<String,
ColumnInstructions> The column instructions keyed by Deephaven column name from thedefinition
.abstract TableDefinition
The Deephaven table definition.static Resolver
infer
(InferenceInstructions inferenceInstructions) Infer a resolver based on theinferenceInstructions
.static Resolver
infer
(org.apache.iceberg.Schema schema) Infer a resolver based on the default inference instructions forschema
.Get the field path associated with the DeephavencolumnName
.abstract org.apache.iceberg.Schema
schema()
The Iceberg schema.abstract Optional<org.apache.iceberg.PartitionSpec>
spec()
The Iceberg partition specification.
-
Constructor Details
-
Resolver
public Resolver()
-
-
Method Details
-
builder
-
infer
Infer a resolver based on the default inference instructions forschema
.Equivalent to
infer(InferenceInstructions.of(schema))
.- Parameters:
schema
- the schema to use for inference- Returns:
- the resolver
- Throws:
TypeInference.UnsupportedType
- if an unsupported type is encountered- See Also:
-
infer
public static Resolver infer(InferenceInstructions inferenceInstructions) throws TypeInference.UnsupportedType Infer a resolver based on theinferenceInstructions
.- Parameters:
inferenceInstructions
- the inference instructions- Returns:
- the resolver
- Throws:
TypeInference.UnsupportedType
- if an unsupported type is encountered
-
definition
The Deephaven table definition. Everycolumn
of this definition must be mapped viacolumnInstructions()
.Callers should take care and only use
Partitioning
columns when they know the Iceberg table will always haveidentity
partitions for said columns. In the general case, Iceberg partitions may evolve over time, which can break the assumptions Deephaven makes about partitioning columns. -
schema
public abstract org.apache.iceberg.Schema schema()The Iceberg schema. -
spec
The Iceberg partition specification. Only necessary to set when thedefinition()
hasColumnDefinition.ColumnType.Partitioning
columns, orcolumnInstructions()
referencespartition fields
.- See Also:
-
columnInstructions
The column instructions keyed by Deephaven column name from thedefinition
.Normal
columns must reference aschema field
,schema field name
, or beunmapped
; andpartitioning
columns must reference aschema field
,schema field name
, orpartition field
.The
definition()
andschema()
types must beTypeCompatibility.isCompatible(Type, org.apache.iceberg.types.Type)
. -
resolve
Get the field path associated with the DeephavencolumnName
. Will return empty when the column name is not incolumnInstructions()
, and a result otherwise.- Parameters:
columnName
- the column name- Returns:
- the field path
-