jackylee-ch opened a new pull request, #25996:
URL: https://github.com/apache/datafusion/pull/25996

   ## Which issue does this PR close?
   
   - N/A
   
   ## Rationale for this change
   
   `map_extract(1, 1)` (and `element_at(1, 1)`, which dispatches to it) fails 
during planning with `Internal error: Expected a Map type, got Int64 ... a bug 
in DataFusion`. A wrong argument type is a user error, not a bug: `map_extract` 
defers type checking to `coerce_types` -> `get_map_entry_field`, which returned 
`internal_err!` for a non-map type.
   
   ## What changes are included in this PR?
   
   `get_map_entry_field` now returns a plan error for a non-map argument. The 
`Expected a Struct type` arm stays internal — an Arrow `Map` always has a 
`Struct` entries field.
   
   ## What is the testing strategy for this PR?
   
   `map.slt` cases for `element_at(1, 1)` and `map_extract(1, 1)`: internal 
error on `main`, plan error with this change.
   
   ## Are there any user-facing changes?
   
   `map_extract`/`element_at` report a non-map argument as a plan error, not an 
internal error.
   


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