Describe the bug
During fuzz testing, I am seeing errors reading decimals (or maybe when sorting decimals).
SQL
SELECT c7, cast(c7 as SMALLINT), try_cast(c7 as SMALLINT) FROM local.db.test0 ORDER BY c7;
Note that c7 is defined as Decimal128(10, 2).
Spark Plan
AdaptiveSparkPlan isFinalPlan=true
+- == Final Plan ==
*(2) Sort [c7#6669 ASC NULLS FIRST], true, 0
+- AQEShuffleRead coalesced
+- ShuffleQueryStage 0
+- Exchange rangepartitioning(c7#6669 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=8959]
+- *(1) Project [c7#6669, cast(c7#6669 as smallint) AS c7#6675, try_cast(c7#6669 as smallint) AS c7#6676]
+- *(1) ColumnarToRow
+- BatchScan local.db.test0[c7#6669] local.db.test0 (branch=null) [filters=, groupedBy=] RuntimeFilters: []
+- == Initial Plan ==
Sort [c7#6669 ASC NULLS FIRST], true, 0
+- Exchange rangepartitioning(c7#6669 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, [plan_id=8946]
+- Project [c7#6669, cast(c7#6669 as smallint) AS c7#6675, try_cast(c7#6669 as smallint) AS c7#6676]
+- BatchScan local.db.test0[c7#6669] local.db.test0 (branch=null) [filters=, groupedBy=] RuntimeFilters: []
Comet Plan
AdaptiveSparkPlan isFinalPlan=true
+- == Final Plan ==
*(1) CometColumnarToRow
+- CometSort [c7#6697, c7#6703, c7#6704], [c7#6697 ASC NULLS FIRST]
+- AQEShuffleRead coalesced
+- ShuffleQueryStage 0
+- CometColumnarExchange rangepartitioning(c7#6697 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=9021]
+- CometProject [c7#6697, c7#6703, c7#6704], [c7#6697, cast(c7#6697 as smallint) AS c7#6703, try_cast(c7#6697 as smallint) AS c7#6704]
+- CometBatchScan local.db.test0[c7#6697] local.db.test0 (branch=null) [filters=, groupedBy=] RuntimeFilters: []
+- == Initial Plan ==
CometSort [c7#6697, c7#6703, c7#6704], [c7#6697 ASC NULLS FIRST]
+- CometColumnarExchange rangepartitioning(c7#6697 ASC NULLS FIRST, 200), ENSURE_REQUIREMENTS, CometColumnarShuffle, [plan_id=9008]
+- CometProject [c7#6697, c7#6703, c7#6704], [c7#6697, cast(c7#6697 as smallint) AS c7#6703, try_cast(c7#6697 as smallint) AS c7#6704]
+- CometBatchScan local.db.test0[c7#6697] local.db.test0 (branch=null) [filters=, groupedBy=] RuntimeFilters: []
First difference at row 1:
Spark: 0.01,0,0
Comet: 0.00,0,0
Steps to reproduce
No response
Expected behavior
No response
Additional context
No response
Describe the bug
During fuzz testing, I am seeing errors reading decimals (or maybe when sorting decimals).
SQL
Note that
c7is defined asDecimal128(10, 2).Spark Plan
Comet Plan
First difference at row 1:
Spark:
0.01,0,0Comet:
0.00,0,0Steps to reproduce
No response
Expected behavior
No response
Additional context
No response