[VL] Native Delta writes fail on DOUBLE partition columns instead of falling back

Open
#13,138 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
scala

Research direction

Start with the two failing cases in org.apache.spark.sql.delta.DeltaUpdateCatalogSuite and reproduce the DOUBLE-partition write using the provided configuration. Trace the native Delta write entry point to Velox's PartitionIdGenerator.cpp and compare supported partition types with ordinary DOUBLE data columns. Done means unsupported partition columns fall back, supported partitions remain native, and regression coverage is added while the #13131 known-failure entries can be removed.

Written by the indexing model from the issue text.

Description

Backend

VL (Velox)

Bug description

Expected behavior: A valid Delta write partitioned by a Spark DOUBLE column should succeed. If Velox cannot write that partition type, Gluten should validate the partition columns and fall back to Spark's Delta writer before starting the write.

Current status (2026-10-19): the original tests now pass, but this does not establish native DOUBLE partition support.

The rebase of #13131 brought in #13271 and Delta 4.4.1. Delta now defaults to writing partition columns inside Parquet data files. GlutenDeltaNativeWriteGate rejects that layout for native writing and selects the vanilla Delta writer before Velox's partition-ID generation. This is a general write-layout fallback, not a check specifically rejecting DOUBLE partition columns.

Both original org.apache.spark.sql.delta.DeltaUpdateCatalogSuite cases now pass in CI run 39332447295, shard 3:

  • creating and replacing a table puts the schema and table properties in the metastore
  • partitioned table + add column

The tests still derive part as id / 2 (DOUBLE) and retain their assertions. Their temporary known-failure entries were removed in 95e93654e; the tests remain enabled.

Remaining scenario to verify: a DOUBLE partition with delta.writePartitionColumnsToParquet=false, without Iceberg compatibility or the materialized-partition-columns feature forcing partition columns into the files. The layout-based fallback no longer applies in that configuration. Its current behavior has not yet been reproduced, so neither continued failure nor full resolution should be inferred from the passing default-configured tests.

Candidate reproduction for that follow-up, using a fresh table and a Spark session configured for Delta and Gluten:

import org.apache.spark.sql.functions.col

val df = spark.range(10)
  .withColumn("part", col("id") / 2)
  .withColumn("id2", col("id"))

df.writeTo("delta_double_partition_repro")
  .tableProperty("delta.writePartitionColumnsToParquet", "false")
  .partitionedBy(col("part"))
  .using("delta")
  .create()

The explicit table property is the proposed follow-up condition, not part of the original observed Delta 4.2.0 failure. Keep this issue open until that scenario is verified. If unsupported partition types still reach Velox, add partition-type validation and fall back before writing; preserve native eligibility for supported partition types and ordinary DOUBLE data columns.

Original behavior (Delta 4.2.0): With native Delta writes enabled, the two tests above reached Velox's PartitionIdGenerator and failed with Unsupported partition type: DOUBLE., wrapped as [TASK_WRITE_FAILED], before their catalog assertions. #13131 exposed this in the Hive-based fixture by configuring Gluten/native Delta writing consistently. This is separate from the task-resource initialization failure and the adaptive-prefetch SIGFPE.

Original test sources:

This description was updated with assistance from GitHub Copilot 1.0.99-2 (GPT-6 Astra).

Gluten version

main branch / 1.8.0-SNAPSHOT.

Original failure: #13131 at migration commit 9388f6307c6e618ee0fab25375e1d21b006a91c4, CI merge commit a28c4edc8b4ed35c7b02dfab3fba74a2b88c765b, without an upstream Velox PR override.

Passing default-configured cases: #13131 at c2161f6c8f8be2fd42b1c98c4a8ab92313f330c4, rebased onto e920e70e453fe9d035e84fd75b635ba03324f387 (#13271).

Spark version

Spark-4.1.x. The original Delta v4.2.0 tests selected Spark 4.1.0; their CI bundle metadata reports Spark 4.1.1 and Scala 2.13.17. The passing rebased run uses Delta v4.4.1 with Spark profile 4.1.

Spark configurations

Relevant effective defaults, with native Delta writing still enabled:

spark.plugins=org.apache.gluten.GlutenPlugin
spark.shuffle.manager=org.apache.spark.shuffle.sort.ColumnarShuffleManager
spark.memory.offHeap.enabled=true
spark.memory.offHeap.size=2g
spark.default.parallelism=1
spark.sql.shuffle.partitions=5
spark.sql.ansi.enabled=false
spark.gluten.sql.ansiFallback.enabled=false
spark.gluten.sql.columnar.backend.velox.delta.enableNativeWrite=true
spark.databricks.delta.snapshotPartitions=2

The Delta fixture also configures io.delta.sql.DeltaSparkSessionExtension and org.apache.spark.sql.delta.catalog.DeltaCatalog.

For the unverified follow-up, explicitly set the table property delta.writePartitionColumnsToParquet=false and ensure no table feature forces partition columns into the data files.

System information

Original CI run 36165436135, shard 3: JDK 17.0.20, Linux runner, apache/gluten:centos-9-jdk17 test container; native build used CentOS 8 and GCC 13.3.1. IBM Velox pin: dft-2026_09_25 (340ab366bdf5a7c25c913c84730227675aad72c5).

Passing rebased run 39332447295, shard 3: Delta 4.4.1, JDK 17.0.20.1, with Gluten and native Delta writing enabled. These are different dependency snapshots; the passing result should not be attributed to new native DOUBLE support without further verification.

dev/info.sh output from the CI runners is not available; details above come from the workflow, build metadata, and test reports.

Relevant logs

Historical failure: CI job and test step, at 2026-09-25T18:52:38Z and 2026-09-25T18:53:04Z. Both XML reports and the log contain:

org.apache.spark.SparkException: [TASK_WRITE_FAILED] Task failed while writing rows ...
Cause: org.apache.gluten.exception.GlutenException: Exception: VeloxUserError
Error Source: USER
Error Code: INVALID_ARGUMENT
Reason: Unsupported partition type: DOUBLE.
Retriable: False
Expression: hashers_.back()->typeSupportsValueIds()
Function: PartitionIdGenerator
File: /work/ep/build-velox/build/velox_ep/velox/connectors/hive/PartitionIdGenerator.cpp
Line: 34

Current default-configured result: CI run 39332447295 reports both original cases as passing in both XML reporters. Its shard gate failed only because four catalog cases were still listed as known failures despite passing; there were zero new regressions. Those obsolete baseline entries were subsequently removed in 95e93654e.

Dominant language
Scala
Stars
1.6k
Forks
679
Avg merge
4d 16h
Merged PRs (30d)
84

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from apache/gluten

All issues in apache/gluten

Similar issues

More Scala issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.