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

オープン
#13,138 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
scala

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Scala
スター
1.6k
フォーク
685
平均マージ
4日 16時間
マージ済み PR(30日)
84

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/gluten のほかの issue

apache/gluten の issue をすべて見る

似ている issue

Scala の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。