Jefffrey commented on code in PR #19441:
URL: https://github.com/apache/datafusion/pull/19441#discussion_r2637884207


##########
datafusion/common/src/scalar/mod.rs:
##########
@@ -3027,7 +3028,13 @@ impl ScalarValue {
             },
             ScalarValue::Utf8View(e) => match e {
                 Some(value) => {
-                    Arc::new(StringViewArray::from_iter_values(repeat_n(value, 
size)))
+                    let mut builder =
+                        
StringViewBuilder::with_capacity(size).with_deduplicate_strings();
+                    for _ in 0..size {
+                        builder.append_value(value);
+                    }
+                    let array = builder.finish();
+                    Arc::new(array)

Review Comment:
   Actually if we have a benchmark maybe it could be worth testing out if there 
is a performance gain by doing this? 🤔 



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