dharanad commented on code in PR #11780: URL: https://github.com/apache/datafusion/pull/11780#discussion_r1702128317
########## datafusion/sql/src/expr/mod.rs: ########## @@ -714,6 +717,37 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> { not_impl_err!("Unsupported dictionary literal: {raw_expr:?}") } + fn try_plan_map_literal( + &self, + entries: Vec<MapEntry>, + schema: &DFSchema, + planner_context: &mut PlannerContext, + ) -> Result<Expr> { + let mut exprs = vec![]; + entries.into_iter().try_for_each(|entry| { + exprs.push(self.sql_expr_to_logical_expr( + *entry.key, + schema, + planner_context, + )?); + exprs.push(self.sql_expr_to_logical_expr( + *entry.value, + schema, + planner_context, + )?); + Ok::<_, DataFusionError>(()) + })?; + for planner in self.context_provider.get_expr_planners() { + match planner.plan_make_map(exprs)? { + PlannerResult::Planned(expr) => { + return Ok(expr); + } + PlannerResult::Original(expr) => exprs = expr, + } + } + not_impl_err!("Unsupported MAP literal: {exprs:?}") Review Comment: Can we change it to `MAP not supported by ExprPlanner: {exprs:?}` to maintains consistency with other errors in the file. -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org