Skip to content

[FEATURE] Native top-level Variant projection from ordinary Parquet #5546

Description

@peterxcli

What problem does this solve?

#5407 implements the ordinary-Parquet phase of #4295, but it now combines several independently reviewable concerns: shared Arrow FFI schema export, Variant logical-type transport, native whole-value normalization, Spark-compatible Parquet physical semantics, and scan admission/schema-evolution defaults.

This issue tracks re-landing that work as five atomic pull requests under the broader Variant roadmap in #5438, following the maintainer request in #5407 (comment).

Scope

Support direct, top-level, whole-value VariantType projection from ordinary Parquet:

SELECT v FROM parquet_table;
SELECT id, v, tail FROM parquet_table;

The completed series preserves Variant identity through:

Spark VariantType
  -> Comet protobuf
  -> marked Arrow Field
  -> ordinary native Parquet scan
  -> whole-value normalization
  -> Arrow C Data Interface
  -> CometStructVector
  -> ColumnVector.getVariant

This tracker does not include Iceberg, nested Variant, Variant expressions, subfield pruning, predicate pushdown, writes, columnar-to-row, shuffle/spill, or Python transport.

Ordered subtasks

Each pull request must include focused tests and retain explicit Spark fallback until the complete scan boundary is ready.

Definition of done

  • Direct top-level Variant projection remains a Comet native Parquet scan and matches Spark.
  • Fields before and after Variant retain their order.
  • Objects, arrays, scalars, Variant JSON null, SQL NULL, and nullable parents round-trip.
  • Canonical unshredded and shredded inputs reconstruct whole values.
  • Spark receives logical VariantType with exactly [value, metadata] children.
  • Unread Variant pruning from feat: Support native scans with unprojected Spark 4 VARIANT columns #5377 remains native.
  • Unsupported expressions, nested Variant, pushed VariantStruct, native writes, C2R, shuffle/spill, Python operators, and Iceberg retain explicit fallback.
  • Spark 3.x compilation and behavior remain unchanged.

Related work

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions