Package io.deephaven.iceberg.util
Class Resolver
java.lang.Object
io.deephaven.iceberg.util.Resolver
- All Implemented Interfaces:
ResolverProvider
The relationship between a Deephaven
TableDefinition and an Iceberg Schema.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic classNested classes/interfaces inherited from interface io.deephaven.iceberg.util.ResolverProvider
ResolverProvider.Visitor<T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Resolver.Builderbuilder()abstract Map<String,ColumnInstructions> The column instructions keyed by Deephaven column name from thedefinition.abstract TableDefinitionThe Deephaven table definition.static Resolverinfer(InferenceInstructions inferenceInstructions) Infer a resolver based on theinferenceInstructions.static Resolverinfer(org.apache.iceberg.Schema schema) Infer a resolver based on the default inference instructions forschema.Get the field path associated with the DeephavencolumnName.final org.apache.iceberg.Schemaschema()The Iceberg schema.abstract Optional<org.apache.iceberg.PartitionSpec>spec()The Iceberg partition specification.final <T> Twalk(ResolverProvider.Visitor<T> visitor)
-
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. Everycolumnof this definition must be mapped viacolumnInstructions().Callers should take care and only use
Partitioningcolumns when they know the Iceberg table will always haveidentitypartitions 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 final org.apache.iceberg.Schema schema()The Iceberg schema. Equality for this Schema is defined bySchemaProvider.sameSchemaAndId(Schema, Schema). -
spec
The Iceberg partition specification. Only necessary to set when thedefinition()hasColumnDefinition.ColumnType.Partitioningcolumns, orcolumnInstructions()referencespartition fields.- See Also:
-
columnInstructions
The column instructions keyed by Deephaven column name from thedefinition.Normalcolumns must reference aschema field,schema field name, or beunmapped; andpartitioningcolumns 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
-
walk
- Specified by:
walkin interfaceResolverProvider
-