andygrove commented on issue #5013:
URL: 
https://github.com/apache/datafusion-comet/issues/5013#issuecomment-5152054953

   Still reproduces on `apache/main` @ `ba21f02de` (default Maven profile, 
Spark 4.1.2, macOS aarch64,
   debug build), re-checked while re-running the #4180 audit. Recording the 
exact surface so whoever
   fixes it knows what the gate has to cover:
   
   | Expression | Result |
   |---|---|
   | `cast(bigint as decimal(10,-1))` | panic, `core/src/num/mod.rs:475`, 
multiply overflow |
   | `cast(bigint as decimal(20,-5))` | same panic |
   | `cast(bigint as decimal(10,-1)).cast("string")` | same panic |
   | `cast(... as decimal(10,-1)) + cast(... as decimal(10,-1))` | panic, 
`planner.rs:917`, subtract overflow |
   | `filter(cast(n as decimal(10,-1)) > 0)` | same panic, inside `CometFilter` 
|
   
   Two paths that do **not** panic and match Spark, so a fix should not 
over-reject them:
   `cast(double as decimal(10,-1))` and `cast(decimal(10,2) as decimal(12,-2))`.
   
   Worth noting for the fix: the existing gate at `CometCast.scala:297-307` 
reports negative-scale
   decimal-to-string as `Compatible()` **when 
`spark.sql.legacy.allowNegativeScaleOfDecimal` is
   `true`**, which is precisely the configuration that panics. The condition is 
the right way round
   for the intent stated in the comment but the wrong way round for what the 
native kernel can
   actually do today.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to