Mryange commented on code in PR #55877:
URL: https://github.com/apache/doris/pull/55877#discussion_r2339934043


##########
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:
   `C++
       const auto* key_string_column = check_and_get_column<ColumnString>(
               assert_cast<const 
ColumnNullable&>(keys_column).get_nested_column());
   
       if (key_string_column == nullptr) {
           return Status::InternalError("Cast to Jsonb failed, map key is not 
string type");
       }
   `
   在be上报错了



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