0lai0 opened a new issue, #7086:
URL: https://github.com/apache/datafusion-comet/issues/7086

   ### Describe the bug
   
   #6973 fixed the panics in `literal_to_array_ref` and 
`create_binary_expr_with_options`, but the native planner still has many 
`unwrap` calls on values decoded from the protobuf plan. If any of them sees an 
unexpected shape, the planner panics instead of returning an `ExecutionError`. 
The panic is caught at the JNI boundary, so the query fails with a panic 
message and backtrace rather than a clear planning error.
   
   Known places:
   
   - `native/core/src/execution/planner.rs`: about 100 `.unwrap()` calls 
outside the test module, many on optional protobuf fields such as 
`expr.left.as_ref().unwrap()`.
   - `native/core/src/execution/expressions/arithmetic.rs`: the arithmetic 
builders unwrap `left` and `right`.
   - `native/core/src/execution/serde.rs`: `to_arrow_datatype` unwraps 
`DataTypeId::try_from(type_id)` and the decimal `type_info`, so an unknown type 
id panics.
   
   ### Expected behavior
   
   Values read from the protobuf plan are validated and return `GeneralError` 
when missing or malformed. `unwrap` stays only where an invariant is 
established locally, such as a match guard.
   
   ### Additional context
   
   Most of these are likely unreachable from the current serde, so this is tech 
debt rather than a user-facing bug. It is probably best done in a few PRs 
grouped by area, so that each one stays reviewable.


-- 
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