HappenLee commented on code in PR #17973:
URL: https://github.com/apache/doris/pull/17973#discussion_r1142371081


##########
be/src/vec/exprs/table_function/vexplode_json_array.h:
##########
@@ -63,32 +63,29 @@ struct ParsedData {
         }
     }
 
-    void get_value(ExplodeJsonArrayType type, int64_t offset, void** output, 
bool real = false) {
+    void* get_value(ExplodeJsonArrayType type, int64_t offset, bool real = 
false) {
         switch (type) {
         case ExplodeJsonArrayType::INT:
         case ExplodeJsonArrayType::DOUBLE:
-            *output = _data[offset];
-            break;
+            return _data[offset];
         case ExplodeJsonArrayType::STRING:
-            *output = _string_nulls[offset] ? nullptr
-                      : real                ? 
reinterpret_cast<void*>(_backup_string[offset].data())
-                                            : &_data_string[offset];
-            break;
+            return _string_nulls[offset] ? nullptr
+                   : real                ? 
reinterpret_cast<void*>(_backup_string[offset].data())
+                                         : &_data_string[offset];
         default:
-            CHECK(false) << type;
+            return nullptr;
         }
     }
 
-    void get_value_length(ExplodeJsonArrayType type, int64_t offset, int64_t* 
length) {
+    int64 get_value_length(ExplodeJsonArrayType type, int64_t offset) {
         switch (type) {

Review Comment:
   no need switch case only if (ExplodeJsonArrayType::STRING) enough



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