tshauck commented on code in PR #12224:
URL: https://github.com/apache/datafusion/pull/12224#discussion_r1737152586


##########
datafusion/functions/src/string/concat.rs:
##########
@@ -46,7 +45,7 @@ impl ConcatFunc {
     pub fn new() -> Self {
         use DataType::*;
         Self {
-            signature: Signature::variadic(vec![Utf8], Volatility::Immutable),
+            signature: Signature::variadic(vec![Utf8, Utf8View], 
Volatility::Immutable),

Review Comment:
   Sorry, should've been clearer, to your point, I think it works but causes a 
cast to utf8.
   
   ```
   > CREATE TABLE ttt AS SELECT arrow_cast('T', 'LargeUtf8') AS a;
   0 row(s) fetched. 
   Elapsed 0.012 seconds.
   
   > SELECt ttt.a FROM ttt;
   +---+
   | a |
   +---+
   | T |
   +---+
   1 row(s) fetched. 
   Elapsed 0.007 seconds.
   
   > EXPLAIN SELECt ttt.a FROM ttt;
   +---------------+-----------------------------------------------+
   | plan_type     | plan                                          |
   +---------------+-----------------------------------------------+
   | logical_plan  | TableScan: ttt projection=[a]                 |
   | physical_plan | MemoryExec: partitions=1, partition_sizes=[1] |
   |               |                                               |
   +---------------+-----------------------------------------------+
   2 row(s) fetched. 
   Elapsed 0.007 seconds.
   
   > EXPLAIN SELECt concat(ttt.a, ttt.a) FROM ttt;
   
+---------------+--------------------------------------------------------------------------------------------+
   | plan_type     | plan                                                       
                                |
   
+---------------+--------------------------------------------------------------------------------------------+
   | logical_plan  | Projection: concat(__common_expr_1 AS ttt.a, 
__common_expr_1 AS ttt.a)                     |
   |               |   Projection: CAST(ttt.a AS Utf8) AS __common_expr_1       
                                |
   |               |     TableScan: ttt projection=[a]                          
                                |
   | physical_plan | ProjectionExec: expr=[concat(__common_expr_1@0, 
__common_expr_1@0) as concat(ttt.a,ttt.a)] |
   |               |   ProjectionExec: expr=[CAST(a@0 AS Utf8) as 
__common_expr_1]                              |
   |               |     MemoryExec: partitions=1, partition_sizes=[1]          
                                |
   |               |                                                            
                                |
   
+---------------+--------------------------------------------------------------------------------------------+
   ```
   
   I think if you were to concat two largeutf8s together, you should get that 
same type as the return?



-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to