[Bug] hll_* errors surface as Comet errors instead of HLL_INVALID_INPUT_SKETCH_BUFFER / HLL_UNION_DIFFERENT_LG_K

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

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust, scala, spark
領域
backend, testing

調査の方向性

Start with native/common/src/error.rs and the spark-4.x ShimSparkErrorConverter, then inspect nearby error conversion tests and HLL SQL tests. Reproduce the invalid-buffer query and the different-lgConfigK case against Spark and Comet. Done means both cases expose Spark’s specified error condition and SQLSTATE, with regression coverage.

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

説明

area:expressions bug priority:low
Describe the bug

When the native HLL expressions fail, Comet raises a plain Comet execution error instead of Spark's SparkRuntimeException with the HLL error condition. Both engines fail on the same inputs, but the error class, SQLSTATE and message differ.

Expression Spark error condition (SQLSTATE)
hll_sketch_estimate, hll_union, hll_union_agg on an invalid buffer HLL_INVALID_INPUT_SKETCH_BUFFER (22546)
hll_union, hll_union_agg with different lgConfigK and allowDifferentLgConfigK = false HLL_UNION_DIFFERENT_LG_K (22000)

native/common/src/error.rs SparkError has no HLL variant, so these errors cannot reach SparkErrorConverter / ShimSparkErrorConverter.

Steps to reproduce
SELECT hll_sketch_estimate(X'0102030405');

Spark 4.x raises [HLL_INVALID_INPUT_SKETCH_BUFFER] Invalid call to hll_sketch_estimate; only valid HLL sketch buffers are supported as inputs ... with SQLSTATE 22546. Comet raises a Comet execution error with a different message.

Expected behavior

Comet raises the same error condition and SQLSTATE as Spark. A likely fix, following https://github.com/apache/datafusion-comet/issues/5072 :

  • add SparkError variants for the two conditions in native/common/src/error.rs;
  • map them in the spark-4.x ShimSparkErrorConverter to QueryExecutionErrors.hllInvalidInputSketchBuffer(function) and QueryExecutionErrors.hllUnionDifferentLgK(left, right, function);
  • cover them with expect_error_class SQL tests or checkSparkError.
Additional context

Surfaced by the HLL audit for https://github.com/apache/datafusion-comet/issues/7396 . The comparison experiment confirmed both engines fail on the same inputs ( https://github.com/apache/datafusion-comet/issues/7396#issuecomment-6703600973 ). The serdes currently list this as an incompatible reason that is never returned; the audit PR moves it to a compatibility note that links here.

Willingness to contribute

I can contribute a fix for this bug independently

主要言語
Scala
スター
1.3k
フォーク
414
平均マージ
3日 5時間
マージ済み PR(30日)
210

環境構築

はじめの一歩

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

apache/datafusion-comet のほかの issue

apache/datafusion-comet の issue をすべて見る

似ている issue

Scala の issue をもっと見る

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

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