goldmedal commented on code in PR #17620:
URL: https://github.com/apache/datafusion/pull/17620#discussion_r2367315054


##########
datafusion/sqllogictest/test_files/async_udf.slt:
##########
@@ -0,0 +1,46 @@
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+
+#   http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+statement ok
+create table data(x int) as values (-10), (2);
+
+# Async udf can be used in aggregation
+query I
+select min(async_abs(x)) from data;
+----
+2

Review Comment:
   Maybe we can add the tests to check if the generated plans are expected for 
each SQL.
   ```suggestion
   # Async udf can be used in aggregation
   query I
   select min(async_abs(x)) from data;
   ----
   2
   
   query TT
   explain select min(async_abs(x)) from data;
   ----
   logical_plan
   01)Aggregate: groupBy=[[]], aggr=[[min(async_abs(data.x))]]
   02)--TableScan: data projection=[x]
   physical_plan
   01)AggregateExec: mode=Final, gby=[], aggr=[min(async_abs(data.x))]
   02)--CoalescePartitionsExec
   03)----AggregateExec: mode=Partial, gby=[], aggr=[min(async_abs(data.x))]
   04)------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1
   05)--------AsyncFuncExec: async_expr=[async_expr(name=__async_fn_0, 
expr=async_abs(x@0))]
   06)----------CoalesceBatchesExec: target_batch_size=8192
   07)------------DataSourceExec: partitions=1, partition_sizes=[1]
   ```



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