Class IndexByName


  • public class IndexByName
    extends TypeUtil.SchemaVisitor<java.util.Map<java.lang.String,​java.lang.Integer>>
    • Constructor Detail

      • IndexByName

        public IndexByName()
      • IndexByName

        public IndexByName​(java.util.function.Function<java.lang.String,​java.lang.String> quotingFunc)
    • 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
      • 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 class TypeUtil.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 class TypeUtil.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 class TypeUtil.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 class TypeUtil.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 class TypeUtil.SchemaVisitor<java.util.Map<java.lang.String,​java.lang.Integer>>