github-actions[bot] commented on code in PR #63322:
URL: https://github.com/apache/doris/pull/63322#discussion_r3256322828


##########
be/src/util/json/json_parser.h:
##########
@@ -53,16 +55,31 @@ Field getValueAsField(const Element& element) {
     if (element.isUInt64()) {
         return 
Field::create_field<TYPE_LARGEINT>(static_cast<int128_t>(element.getUInt64()));
     }
+    if (element.isInt128()) {
+        if (preserve_number_as_string) {
+            return 
Field::create_field<TYPE_STRING>(String(element.getRawNumber()));
+        }
+        return Field::create_field<TYPE_LARGEINT>(element.getInt128());
+    }
+    if (element.isBigInteger()) {
+        if (preserve_number_as_string) {
+            return 
Field::create_field<TYPE_STRING>(String(element.getRawNumber()));
+        }
+        return {};
+    }

Review Comment:
   When raw preservation is enabled for any decimal typed path in the Variant 
column, the whole document is parsed through the ondemand `Node` tree. For an 
unrelated path containing a JSON integer larger than UInt64, `isBigInteger()` 
reaches this branch with `preserve_number_as_string == false` and returns a 
null `Field`, so a value that used to be present in an untyped path is silently 
stored as NULL/missing just because another path in the schema needs decimal 
preservation. For example, with a decimal typed path `a`, loading `{"a": 1.23, 
"b": 340282366920938463463374607431768211456}` loses `b`. Please preserve 
non-decimal big integers as a string (or otherwise keep the previous behavior) 
instead of returning null, and add a regression where a decimal typed path 
coexists with an unrelated oversized integer path.



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