Class VariantUtils

java.lang.Object
ai.rapids.cudf.VariantUtils

public class VariantUtils extends Object
Utility methods for cuDF's experimental Parquet Variant extraction APIs.
  • Method Details

    • getVariantFieldValue

      public static ColumnVector getVariantFieldValue(ColumnView variantStruct, String path)
      Extract raw Variant-encoded value bytes at path from a Variant struct column.
      Parameters:
      variantStruct - Variant materialization: STRUCT(metadata LIST<UINT8>, value LIST<UINT8>, optional shredded children...)
      path - JSONPath-like path accepted by cuDF's Variant extractor. Paths are expected to be ASCII object-field paths like x, $.x, or $.x.y.
      Returns:
      LIST<UINT8> column of raw encoded Variant values
    • castVariantValue

      public static ColumnVector castVariantValue(ColumnView valueBytes, DType targetType)
      Decode raw Variant-encoded value bytes into targetType. Supported target types are DType.STRING, DType.INT8, DType.INT16, DType.INT32, and DType.INT64.
    • extractVariantField

      public static ColumnVector extractVariantField(ColumnView variantStruct, String path, DType targetType)
      Extract a Variant field and decode it into targetType in one native call. Supported target types are DType.STRING, DType.INT8, DType.INT16, DType.INT32, and DType.INT64.