twalthr commented on code in PR #27777:
URL: https://github.com/apache/flink/pull/27777#discussion_r2941601109
##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/inference/CallBindingCallContext.java:
##########
Review Comment:
update isArgumentLiteral as well? A map can only be literal if all children
are also literal
##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/inference/CallBindingCallContext.java:
##########
@@ -354,4 +361,15 @@ private static ColumnList convertColumnList(List<SqlNode>
operands) {
.collect(Collectors.toList());
return ColumnList.of(names);
}
+
+ private static Map<String, String> convertMap(SqlCall mapCall) {
+ final List<SqlNode> operands = mapCall.getOperandList();
+ final Map<String, String> map = new LinkedHashMap<>();
+ for (int i = 0; i < operands.size(); i += 2) {
+ final String key =
SqlLiteral.unchain(operands.get(i)).getValueAs(String.class);
Review Comment:
What happens if this unchaining fails? A map can only be literal if all
children are also literal, otherwise the getArgumentValue must return
Optional.empty()
##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/inference/CallBindingCallContext.java:
##########
@@ -354,4 +361,15 @@ private static ColumnList convertColumnList(List<SqlNode>
operands) {
.collect(Collectors.toList());
return ColumnList.of(names);
}
+
+ private static Map<String, String> convertMap(SqlCall mapCall) {
+ final List<SqlNode> operands = mapCall.getOperandList();
+ final Map<String, String> map = new LinkedHashMap<>();
+ for (int i = 0; i < operands.size(); i += 2) {
+ final String key =
SqlLiteral.unchain(operands.get(i)).getValueAs(String.class);
Review Comment:
how well is null supported in keys and values? officially we support them in
Flink.
--
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]