NEUpanning commented on issue #9326:
URL: 
https://github.com/apache/incubator-gluten/issues/9326#issuecomment-2821125850

   We resolved this issue by implementing the logic of extracting object or 
array to string in `GetJsonObjectFunction::extractStringResult` function. I'd 
like to open a PR in Velox. cc @PHILO-HE 
   ```c++
   case simdjson::ondemand::json_type::object: {
           // For nested case, e.g., for "{"my": {"hello": 10}}", "$.my" will
           // return an object type.
           simdjson::ondemand::object obj;
           if (!rawResult.get_object().get(obj)) {
             bool add_comma = false;
             ss << "{";
             for (auto field : obj) {
               if (add_comma) {
                 ss << ",";
               }
               ss << "\"" << field.key() << "\":";
               // For nested object, we need to quote the string.
               if (!extractStringResult(field.value(), ss, true, true)) {
                 return false;
               }
               add_comma = true;
             }
             ss << "}";
             return true;
           }
           return false;
         }
         case simdjson::ondemand::json_type::array: {
           ss << "[";
           bool add_comma = false;
           simdjson::ondemand::array array;
           if (!rawResult.get_array().get(array)) {
             for (auto child : array) {
               if (add_comma) {
                 ss << ",";
               }
               // For array element, we need to quote the string.
               if (!extractStringResult(child.value(), ss, true, true)) {
                 return false;
               }
               add_comma = true;
             }
             ss << "]";
             return true;
           }
           return false;
         }
   ```


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