alamb commented on code in PR #8463:
URL: https://github.com/apache/arrow-datafusion/pull/8463#discussion_r1421407269


##########
datafusion/expr/src/built_in_function.rs:
##########
@@ -890,8 +890,7 @@ impl BuiltinScalarFunction {
                 // 0 or more arguments of arbitrary type
                 Signature::one_of(vec![VariadicAny, Any(0)], self.volatility())
             }
-            BuiltinScalarFunction::Struct => Signature::variadic(
-                struct_expressions::SUPPORTED_STRUCT_TYPES.to_vec(),

Review Comment:
   I think we can also remove `SUPPORTED_STRUCT_TYPES` entirely (I don't think 
it is used anywhere else)
   
   We can do so as a follow on PR too. 
   
   



##########
datafusion/sqllogictest/test_files/struct.slt:
##########
@@ -58,5 +58,16 @@ select struct(a, b, c) from values;
 {c0: 2, c1: 2.2, c2: b}
 {c0: 3, c1: 3.3, c2: c}
 
+# explain struct scalar function with columns #1

Review Comment:
   👍 
   I double checked and before this PR this query results in casts
   ```
   ❯ explain select struct(a, b, c) from values;
   
+---------------+----------------------------------------------------------------------------------------------------------------+
   | plan_type     | plan                                                       
                                                    |
   
+---------------+----------------------------------------------------------------------------------------------------------------+
   | logical_plan  | Projection: struct(CAST(values.a AS Utf8), CAST(values.b 
AS Utf8), values.c)                                   |
   |               |   TableScan: values projection=[a, b, c]                   
                                                    |
   | physical_plan | ProjectionExec: expr=[struct(CAST(a@0 AS Utf8), CAST(b@1 
AS Utf8), c@2) as struct(values.a,values.b,values.c)] |
   |               |   MemoryExec: partitions=1, partition_sizes=[1]            
                                                    |
   |               |                                                            
                                                    |
   
+---------------+----------------------------------------------------------------------------------------------------------------+
   2 rows in set. Query took 0.009 seconds.
   ```
   
   



##########
datafusion/sqllogictest/test_files/struct.slt:
##########
@@ -58,5 +58,16 @@ select struct(a, b, c) from values;
 {c0: 2, c1: 2.2, c2: b}
 {c0: 3, c1: 3.3, c2: c}
 
+# explain struct scalar function with columns #1

Review Comment:
   👍 
   I double checked and before this PR this query results in casts
   ```
   ❯ explain select struct(a, b, c) from values;
   
+---------------+----------------------------------------------------------------------------------------------------------------+
   | plan_type     | plan                                                       
                                                    |
   
+---------------+----------------------------------------------------------------------------------------------------------------+
   | logical_plan  | Projection: struct(CAST(values.a AS Utf8), CAST(values.b 
AS Utf8), values.c)                                   |
   |               |   TableScan: values projection=[a, b, c]                   
                                                    |
   | physical_plan | ProjectionExec: expr=[struct(CAST(a@0 AS Utf8), CAST(b@1 
AS Utf8), c@2) as struct(values.a,values.b,values.c)] |
   |               |   MemoryExec: partitions=1, partition_sizes=[1]            
                                                    |
   |               |                                                            
                                                    |
   
+---------------+----------------------------------------------------------------------------------------------------------------+
   2 rows in set. Query took 0.009 seconds.
   ```
   
   



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

Reply via email to