Package org.apache.iceberg.types
Class IndexByName
- java.lang.Object
-
- org.apache.iceberg.types.TypeUtil.SchemaVisitor<java.util.Map<java.lang.String,java.lang.Integer>>
-
- org.apache.iceberg.types.IndexByName
-
public class IndexByName extends TypeUtil.SchemaVisitor<java.util.Map<java.lang.String,java.lang.Integer>>
-
-
Constructor Summary
Constructors Constructor Description IndexByName()
IndexByName(java.util.function.Function<java.lang.String,java.lang.String> quotingFunc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterField(Types.NestedField field)
void
afterListElement(Types.NestedField elementField)
void
afterMapKey(Types.NestedField keyField)
void
afterMapValue(Types.NestedField valueField)
void
beforeField(Types.NestedField field)
void
beforeListElement(Types.NestedField elementField)
void
beforeMapKey(Types.NestedField keyField)
void
beforeMapValue(Types.NestedField valueField)
java.util.Map<java.lang.Integer,java.lang.String>
byId()
Returns a mapping from field ID to full name.java.util.Map<java.lang.String,java.lang.Integer>
byName()
Returns a mapping from full field name to ID.java.util.Map<java.lang.String,java.lang.Integer>
field(Types.NestedField field, java.util.Map<java.lang.String,java.lang.Integer> fieldResult)
java.util.Map<java.lang.String,java.lang.Integer>
list(Types.ListType list, java.util.Map<java.lang.String,java.lang.Integer> elementResult)
java.util.Map<java.lang.String,java.lang.Integer>
map(Types.MapType map, java.util.Map<java.lang.String,java.lang.Integer> keyResult, java.util.Map<java.lang.String,java.lang.Integer> valueResult)
java.util.Map<java.lang.String,java.lang.Integer>
primitive(Type.PrimitiveType primitive)
java.util.Map<java.lang.String,java.lang.Integer>
schema(Schema schema, java.util.Map<java.lang.String,java.lang.Integer> structResult)
java.util.Map<java.lang.String,java.lang.Integer>
struct(Types.StructType struct, java.util.List<java.util.Map<java.lang.String,java.lang.Integer>> fieldResults)
-
-
-
Method Detail
-
byName
public java.util.Map<java.lang.String,java.lang.Integer> byName()
Returns a mapping from full field name to ID.Short names for maps and lists are included for any name that does not conflict with a canonical name. For example, a list, 'l', of structs with field 'x' will produce short name 'l.x' in addition to canonical name 'l.element.x'.
- Returns:
- a map from name to field ID
-
byId
public java.util.Map<java.lang.Integer,java.lang.String> byId()
Returns a mapping from field ID to full name.Canonical names, not short names are returned, for example 'list.element.field' instead of 'list.field'.
- Returns:
- a map from field ID to name
-
beforeField
public void beforeField(Types.NestedField field)
- Overrides:
beforeField
in classTypeUtil.SchemaVisitor<java.util.Map<java.lang.String,java.lang.Integer>>
-
afterField
public void afterField(Types.NestedField field)
- Overrides:
afterField
in classTypeUtil.SchemaVisitor<java.util.Map<java.lang.String,java.lang.Integer>>
-
beforeListElement
public void beforeListElement(Types.NestedField elementField)
- Overrides:
beforeListElement
in classTypeUtil.SchemaVisitor<java.util.Map<java.lang.String,java.lang.Integer>>
-
afterListElement
public void afterListElement(Types.NestedField elementField)
- Overrides:
afterListElement
in classTypeUtil.SchemaVisitor<java.util.Map<java.lang.String,java.lang.Integer>>
-
beforeMapKey
public void beforeMapKey(Types.NestedField keyField)
- Overrides:
beforeMapKey
in classTypeUtil.SchemaVisitor<java.util.Map<java.lang.String,java.lang.Integer>>
-
afterMapKey
public void afterMapKey(Types.NestedField keyField)
- Overrides:
afterMapKey
in classTypeUtil.SchemaVisitor<java.util.Map<java.lang.String,java.lang.Integer>>
-
beforeMapValue
public void beforeMapValue(Types.NestedField valueField)
- Overrides:
beforeMapValue
in classTypeUtil.SchemaVisitor<java.util.Map<java.lang.String,java.lang.Integer>>
-
afterMapValue
public void afterMapValue(Types.NestedField valueField)
- Overrides:
afterMapValue
in classTypeUtil.SchemaVisitor<java.util.Map<java.lang.String,java.lang.Integer>>
-
schema
public java.util.Map<java.lang.String,java.lang.Integer> schema(Schema schema, java.util.Map<java.lang.String,java.lang.Integer> structResult)
- Overrides:
schema
in classTypeUtil.SchemaVisitor<java.util.Map<java.lang.String,java.lang.Integer>>
-
struct
public java.util.Map<java.lang.String,java.lang.Integer> struct(Types.StructType struct, java.util.List<java.util.Map<java.lang.String,java.lang.Integer>> fieldResults)
- Overrides:
struct
in classTypeUtil.SchemaVisitor<java.util.Map<java.lang.String,java.lang.Integer>>
-
field
public java.util.Map<java.lang.String,java.lang.Integer> field(Types.NestedField field, java.util.Map<java.lang.String,java.lang.Integer> fieldResult)
- Overrides:
field
in classTypeUtil.SchemaVisitor<java.util.Map<java.lang.String,java.lang.Integer>>
-
list
public java.util.Map<java.lang.String,java.lang.Integer> list(Types.ListType list, java.util.Map<java.lang.String,java.lang.Integer> elementResult)
- Overrides:
list
in classTypeUtil.SchemaVisitor<java.util.Map<java.lang.String,java.lang.Integer>>
-
map
public java.util.Map<java.lang.String,java.lang.Integer> map(Types.MapType map, java.util.Map<java.lang.String,java.lang.Integer> keyResult, java.util.Map<java.lang.String,java.lang.Integer> valueResult)
- Overrides:
map
in classTypeUtil.SchemaVisitor<java.util.Map<java.lang.String,java.lang.Integer>>
-
primitive
public java.util.Map<java.lang.String,java.lang.Integer> primitive(Type.PrimitiveType primitive)
- Overrides:
primitive
in classTypeUtil.SchemaVisitor<java.util.Map<java.lang.String,java.lang.Integer>>
-
-