dharanad commented on code in PR #12259:
URL: https://github.com/apache/datafusion/pull/12259#discussion_r1740093621
##########
datafusion/functions-nested/src/planner.rs:
##########
@@ -148,6 +148,16 @@ impl ExprPlanner for FieldAccessPlanner {
// expr[idx] ==> array_element(expr, idx)
GetFieldAccess::ListIndex { key: index } => {
match expr {
+ // Special case for accessing map value with non-string
values
+ Expr::ScalarFunction(scalar_func) if is_map(&scalar_func)
=> {
+ let Expr::Literal(name) = *index else {
+ return plan_err!("index should be a literal");
+ };
+ Ok(PlannerResult::Planned(get_field(
Review Comment:
`map_extract` returns a list containing the value. Maybe can wrap it around
`get_field` call and extract the value. But i am not sure, let me try it out.
--
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]