xuzifu666 commented on code in PR #4290:
URL: https://github.com/apache/calcite/pull/4290#discussion_r2034309638
##########
core/src/main/java/org/apache/calcite/sql/dialect/ClickHouseSqlDialect.java:
##########
@@ -216,6 +216,24 @@ private static SqlDataTypeSpec
createSqlDataTypeSpecByName(String typeAlias,
}
switch (call.getKind()) {
+ case MAP_VALUE_CONSTRUCTOR:
+ writer.print(call.getOperator().getName().toLowerCase(Locale.ROOT));
+ final SqlWriter.Frame mapFrame = writer.startList("(", ")");
+ for (int i = 0; i < call.operandCount(); i++) {
+ writer.sep(",");
+ call.operand(i).unparse(writer, leftPrec, rightPrec);
+ }
+ writer.endList(mapFrame);
+ break;
+ case ARRAY_VALUE_CONSTRUCTOR:
+ writer.print(call.getOperator().getName().toLowerCase(Locale.ROOT));
Review Comment:
@mihaibudiu It is support in ClickHouse system:
```
select map();
{}
```
```
select array();
[]
```
IMO, there are two ways to solve it:
1. Keep the current version that just handle with map/array with non-empty
args, because the number restrictions are from PlanImpl which take precedence
over dialect system;
2. Remove number restrictions of map/array in
SqlMultisetValueConstructor##checkOperandTypes ;
I prefer to the 1 plan, what do you think about it?
--
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]