goldmedal commented on code in PR #11780:
URL: https://github.com/apache/datafusion/pull/11780#discussion_r1702147467


##########
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>(())
+        })?;

Review Comment:
   I think it's wrong. What `plan_make_map` accepts is `[k1, v1, k2, v2, ... 
]`. The parameters will be arranged to 2 vectors for `map_udf`.
   If we change it to `[[k1, k2, ...], [v1, v2, ...]`, it will become an 
array-to-array map, `MAP {[k1, k2, ...]: [v1, v2, ...]}`.



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