Jefffrey commented on code in PR #19984:
URL: https://github.com/apache/datafusion/pull/19984#discussion_r2725729083
##########
datafusion/sqllogictest/test_files/spark/string/concat.slt:
##########
@@ -46,3 +46,32 @@ SELECT concat(a, b, c) from (select 'a' a, 'b' b, 'c' c
union all select null a,
----
abc
NULL
+
+# Test mixed types: Utf8View + Utf8
+query T
+SELECT concat(arrow_cast('hello', 'Utf8View'), ' world');
+----
+hello world
+
+# Test all three types mixed together
+query T
+SELECT concat('a', arrow_cast('b', 'LargeUtf8'), arrow_cast('c', 'Utf8View'));
+----
+abc
+
Review Comment:
We can use `arrow_typeof()` to check the expected type
##########
datafusion/sqllogictest/test_files/spark/string/concat.slt:
##########
@@ -46,3 +46,32 @@ SELECT concat(a, b, c) from (select 'a' a, 'b' b, 'c' c
union all select null a,
----
abc
NULL
+
+# Test mixed types: Utf8View + Utf8
+query T
+SELECT concat(arrow_cast('hello', 'Utf8View'), ' world');
+----
+hello world
+
+# Test all three types mixed together
+query T
+SELECT concat('a', arrow_cast('b', 'LargeUtf8'), arrow_cast('c', 'Utf8View'));
+----
+abc
+
+# Utf8View: no extra CAST in plan
+statement ok
+CREATE TABLE test_concat_view (a VARCHAR, b VARCHAR) AS VALUES ('foo', 'bar'),
('hello', 'world');
+
+query TT
+EXPLAIN SELECT concat(arrow_cast(a, 'Utf8View'), arrow_cast(b, 'Utf8View'))
FROM test_concat_view;
Review Comment:
I don't think this test is applicable anymore? On main it seems to succeed
just fine
##########
datafusion/spark/src/function/string/concat.rs:
##########
@@ -181,6 +208,24 @@ mod tests {
);
Ok(())
}
+
+ #[test]
+ fn test_concat_utf8view() -> Result<()> {
Review Comment:
Could we move these to SLT tests instead
--
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]