unikdahal commented on code in PR #5414:
URL: https://github.com/apache/datafusion-comet/pull/5414#discussion_r3836727656
##########
native/spark-expr/src/json_funcs/from_json.rs:
##########
@@ -150,27 +150,35 @@ fn json_string_to_struct(arr: &Arc<dyn Array>, schema:
&DataType) -> Result<Arra
} else {
let json_str = string_array.value(row_idx);
- // Parse JSON (PERMISSIVE mode: return null fields on error)
- match serde_json::from_str::<serde_json::Value>(json_str) {
- Ok(json_value) => {
- if let serde_json::Value::Object(obj) = json_value {
- // Struct is not null, extract each field
- *struct_null = true;
- for (field, builder) in
fields.iter().zip(field_builders.iter_mut()) {
- let field_value = obj.get(field.name());
- append_field_value(builder, field, field_value)?;
+ if json_str.trim().is_empty() {
Review Comment:
Fixed. Restricted the blank check to JSON whitespace (space/tab/CR/LF),
verified against
Jackson's actual tokenizer behavior in current Spark source, not just the
old SPARK-19543
comment. Added an NBSP regression row alongside the ordinary blank-input
cases.
--
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]