Skip to content

[GLUTEN-11550][UT] Enable GlutenParquetVariantShreddingSuite for Spark 4.1#11723

Open
baibaichen wants to merge 1 commit intoapache:mainfrom
baibaichen:fix-GlutenParquetVariantShreddingSuite
Open

[GLUTEN-11550][UT] Enable GlutenParquetVariantShreddingSuite for Spark 4.1#11723
baibaichen wants to merge 1 commit intoapache:mainfrom
baibaichen:fix-GlutenParquetVariantShreddingSuite

Conversation

@baibaichen
Copy link
Contributor

@baibaichen baibaichen commented Mar 9, 2026

What changes are proposed in this pull request?

Enable GlutenParquetVariantShreddingSuite for Spark 4.1 by adding fallback logic for Parquet variant logical type annotations.

Spark 4.1 introduced Parquet variant logical type annotations (PARQUET_ANNOTATE_VARIANT_LOGICAL_TYPE, PARQUET_IGNORE_VARIANT_ANNOTATION). When reading a variant-annotated Parquet file with a non-variant schema, Spark's ParquetSchemaConverter validates the annotation and throws an error. Velox native reader does not check variant annotations, so the scan must fall back to vanilla Spark for correct behavior.

Changes:

  • Add shouldFallbackForParquetVariantAnnotation shim method in SparkShims (default: false)
  • Implement variant annotation detection in Spark41Shims: checks PARQUET_IGNORE_VARIANT_ANNOTATION config and recursively scans Parquet schema for VariantLogicalTypeAnnotation
  • Add validateVariantAnnotation in ParquetMetadataUtils (not gated by parquetMetadataValidationEnabled since this is a correctness issue)
  • Call validateVariantAnnotation from VeloxBackend.validateMetadata()
  • Enable GlutenParquetVariantShreddingSuite in spark41 VeloxTestSettings

How was this patch tested?

  • spark41 GlutenParquetVariantShreddingSuite: 7/7 passed (including the previously failing "variant logical type annotation - ignore variant annotation")
  • spark40 GlutenParquetVariantShreddingSuite: 5/5 passed (no regression)

Was this patch authored or co-authored using generative AI tooling?

Generated-by: GitHub Copilot (Claude)

Related issue: #11550

…k 4.1

Fallback to vanilla Spark when Parquet files contain variant logical type
annotations and spark.sql.parquet.ignoreVariantAnnotation is false (default).

Spark 4.1 introduced Parquet variant logical type annotations. When reading
a variant-annotated file with a non-variant schema, Spark's ParquetSchemaConverter
validates the annotation and throws an error. Velox native reader does not check
variant annotations, so the scan must fall back to Spark for correct behavior.

Changes:
- Add shouldFallbackForParquetVariantAnnotation shim method (SparkShims)
- Implement variant annotation detection in Spark41Shims
- Add validateVariantAnnotation in ParquetMetadataUtils (not gated by
  parquetMetadataValidationEnabled since it is a correctness issue)
- Enable GlutenParquetVariantShreddingSuite in spark41 VeloxTestSettings

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions bot added CORE works for Gluten Core VELOX labels Mar 9, 2026
@github-actions
Copy link

github-actions bot commented Mar 9, 2026

Run Gluten Clickhouse CI on x86

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

Labels

CORE works for Gluten Core VELOX

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant