Skip to content

[Variant] Carry Spark VariantType identity through Comet schema serialization #5548

Description

@peterxcli

Problem

Comet cannot represent Spark VariantType in its protobuf, construct a logically marked Arrow Field for it, or recover the logical type from that Field on the JVM.

Parent: #5546
Depends on: #5547

Solution

  • Append VARIANT to DataTypeId without renumbering existing values.
  • Serialize Spark VariantType through Spark-version shims; Spark 3.x remains inert.
  • Map it natively to physical Struct<value: Binary, metadata: Binary>.
  • Attach ARROW:extension:name=arrow.parquet.variant to the outer Field.
  • Make Utils.fromArrowField recognize only that explicit marker.
  • Reuse CometStructVector; do not add a new vector class.
  • Keep general expression, operator, and scan admission gates closed.

This task transports logical identity only. It must not yet admit Variant Parquet scans.

Tests

  • Protobuf and Arrow Field mapping use [value, metadata].
  • Only the explicit extension marker becomes Spark VariantType.
  • An unmarked identical Struct remains StructType.
  • General native Variant expressions remain unsupported.
  • Spark 3.x compiles and behaves unchanged.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:ffiArrow FFI / JNI boundaryarea:scanParquet scan / data readingenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions