goldmedal commented on code in PR #11452:
URL: https://github.com/apache/datafusion/pull/11452#discussion_r1682952179
##########
datafusion/sqllogictest/test_files/map.slt:
##########
@@ -131,17 +131,23 @@ SELECT MAKE_MAP([1,2], ['a', 'b'], [3,4], ['b']);
----
{[1, 2]: [a, b], [3, 4]: [b]}
-query error
+query ?
SELECT MAKE_MAP('POST', 41, 'HEAD', 'ab', 'PATCH', 30);
+----
+{POST: 41, HEAD: ab, PATCH: 30}
Review Comment:
> Alright, so the behaviour is actually depend on `array` itself. I think we
can use `make_array` in this case.
Ok, I'll roll back to `make_array` first.
> current API expects `map(vec![make_array(vec![lit("a"), lit("b")]),
make_array(vec![lit("1"), lit("2")])])` a slightly better API is
`map(vec![lit("a"), lit("b")], vec![lit(1), lit(2)])`
I'm not very familiar with the data frame implementation. Curiously, does
the API for data frames also use the UDF `map`? I think the UDF is a logical
layer function, but we don't have a corresponding logical expression for `vec!`
other than `make_array`.
--
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]