eldenmoon commented on code in PR #55877:
URL: https://github.com/apache/doris/pull/55877#discussion_r2339876829
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/scalar/ToJson.java:
##########
@@ -85,6 +96,13 @@ public List<FunctionSignature> getSignatures() {
DataType firstChildType = child(0).getDataType();
if (firstChildType.isStructType() || firstChildType.isArrayType()) {
return
ImmutableList.of(FunctionSignature.ret(JsonType.INSTANCE).args(firstChildType));
+ }
+ if (firstChildType.isMapType()) {
+ MapType mapType = (MapType) firstChildType;
+ if (!mapType.getKeyType().isStringLikeType()) {
+ throw new IllegalArgumentException("to_json only support map
with string-like key type");
Review Comment:
如果是这个结构呢`map<string, map<int, string>> `
--
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]