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

Aperta
#7,549 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
rust, scala, spark
Ambito
backend, testing

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Scala
Stelle
1.3k
Fork
414
Merge medio
3g 5h
PR unite (30g)
210

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/datafusion-comet

Tutte le issue di apache/datafusion-comet

Issue simili

Altre issue su Scala

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.