davidlghellin commented on code in PR #21264:
URL: https://github.com/apache/datafusion/pull/21264#discussion_r3031987699


##########
datafusion/spark/src/function/json/json_tuple.rs:
##########
@@ -144,14 +147,32 @@ fn json_tuple_inner(args: &[ArrayRef], return_type: 
&DataType) -> Result<ArrayRe
                     }
                     let field_name = field_arrays[field_idx].value(row_idx);
                     match map.get(field_name) {
-                        Some(serde_json::Value::Null) => {
-                            builder.append_null();
-                        }
-                        Some(serde_json::Value::String(s)) => {
-                            builder.append_value(s);
-                        }
-                        Some(other) => {
-                            builder.append_value(other.to_string());
+                        Some(raw) => {
+                            let raw_str = raw.get();
+                            if raw_str == "null" {

Review Comment:
   With RawValue, values are not parsed — they stay as raw JSON text. So the 
JSON literal null arrives as the string "null" (not a Rust None). We compare 
against the raw text to detect it and emit a SQL NULL. This is the same 
behavior as the original serde_json::Value::Null branch, just expressed 
differently since we're working with raw text now.



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