Class ParquetVariantVisitor<R>

java.lang.Object
org.apache.iceberg.parquet.ParquetVariantVisitor<R>
Direct Known Subclasses:
VariantReaderBuilder, VariantWriterBuilder

public abstract class ParquetVariantVisitor<R> extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    afterField(org.apache.parquet.schema.Type type)
    Handler called after visiting any primitive or group type.
    array(org.apache.parquet.schema.GroupType array, R valueResult, R elementResult)
    Handles a shredded array value result and an element value result.
    void
    beforeField(org.apache.parquet.schema.Type type)
    Handler called before visiting any primitive or group type.
    metadata(org.apache.parquet.schema.PrimitiveType metadata)
    Handles a serialized variant metadata column.
    object(org.apache.parquet.schema.GroupType object, R valueResult, List<R> fieldResults)
    Handles a shredded object value result and a list of field value results.
    primitive(org.apache.parquet.schema.PrimitiveType primitive)
    Handles a shredded primitive typed_value column.
    serialized(org.apache.parquet.schema.PrimitiveType value)
    Handles a serialized variant value column.
    value(org.apache.parquet.schema.GroupType value, R valueResult, R typedResult)
    Handles a variant value result and typed_value result pair.
    variant(org.apache.parquet.schema.GroupType variant, R metadataResult, R valueResult)
    Handles the root variant column group.
    static <R> R
    visit(org.apache.parquet.schema.GroupType type, ParquetVariantVisitor<R> visitor)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ParquetVariantVisitor

      public ParquetVariantVisitor()
  • Method Details

    • variant

      public R variant(org.apache.parquet.schema.GroupType variant, R metadataResult, R valueResult)
      Handles the root variant column group.

      The value and typed_value results are combined by calling value(org.apache.parquet.schema.GroupType, R, R).

         group v (VARIANT) { <-- metadata result and combined value and typed_value result
           required binary metadata;
           optional binary value;
           optional ... typed_value;
         }
       
    • metadata

      public R metadata(org.apache.parquet.schema.PrimitiveType metadata)
      Handles a serialized variant metadata column.
         group v (VARIANT) {
           required binary metadata; <-- this column
           optional binary value;
           optional ... typed_value;
         }
       
    • serialized

      public R serialized(org.apache.parquet.schema.PrimitiveType value)
      Handles a serialized variant value column.
         group variant_value_pair {
           optional binary value; <-- this column
           optional ... typed_value;
         }
       
    • primitive

      public R primitive(org.apache.parquet.schema.PrimitiveType primitive)
      Handles a shredded primitive typed_value column.
         group variant_value_pair {
           optional binary value;
           optional int32 typed_value; <-- this column when it is any primitive
         }
       
    • value

      public R value(org.apache.parquet.schema.GroupType value, R valueResult, R typedResult)
      Handles a variant value result and typed_value result pair.

      The value and typed_value pair may be nested in an object field, array element, or in the root group of a variant.

      This method is also called when the typed_value field is missing.

         group variant_value_pair { <-- value result and typed_value result
           optional binary value;
           optional ... typed_value;
         }
       
    • object

      public R object(org.apache.parquet.schema.GroupType object, R valueResult, List<R> fieldResults)
      Handles a shredded object value result and a list of field value results.

      Each field's value and typed_value results are combined by calling value(org.apache.parquet.schema.GroupType, R, R).

         group variant_value_pair {  <-- value result and typed_value field results
           optional binary value;
           optional group typed_value {
             required group a {
               optional binary value;
               optional binary typed_value (UTF8);
             }
             ...
           }
         }
       
    • array

      public R array(org.apache.parquet.schema.GroupType array, R valueResult, R elementResult)
      Handles a shredded array value result and an element value result.

      The element's value and typed_value results are combined by calling value(org.apache.parquet.schema.GroupType, R, R).

         group variant_value_pair {  <-- value result and element result
           optional binary value;
           optional group typed_value (LIST) {
             repeated group list {
               required group element {
                 optional binary value;
                 optional binary typed_value (UTF8);
               }
             }
           }
         }
       
    • beforeField

      public void beforeField(org.apache.parquet.schema.Type type)
      Handler called before visiting any primitive or group type.
    • afterField

      public void afterField(org.apache.parquet.schema.Type type)
      Handler called after visiting any primitive or group type.
    • visit

      public static <R> R visit(org.apache.parquet.schema.GroupType type, ParquetVariantVisitor<R> visitor)