Jefffrey commented on code in PR #23884:
URL: https://github.com/apache/datafusion/pull/23884#discussion_r3662058444
##########
datafusion/spark/src/function/url/parse_url.rs:
##########
@@ -272,20 +272,18 @@ pub fn spark_handled_parse_url(
),
}
} else {
- // The 'key' argument is omitted, assume all values are null
- // Create 'null' string array for 'key' argument
- let mut builder: GenericStringBuilder<i32> =
GenericStringBuilder::new();
- for _ in 0..args[0].len() {
- builder.append_null();
- }
- let key = builder.finish();
+ // The 'key' argument is omitted, assume all values are null.
+ // `new_null_array` allocates the null array outright, rather than
+ // appending one null per row through a builder.
+ let key_array = new_null_array(&DataType::Utf8, args[0].len());
+ let key = key_array.as_string::<i32>();
Review Comment:
```suggestion
let key = StringArray::new_null(args[0].len());
```
--
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]