You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by gi...@apache.org on 2026/04/23 10:57:24 UTC

(datafusion) branch main updated: chore: add aggregation test for listview types (#21776)

This is an automated email from the ASF dual-hosted git repository.

github-merge-queue[bot] pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git


The following commit(s) were added to refs/heads/main by this push:
     new 067ba4b02e chore: add aggregation test for listview types (#21776)
067ba4b02e is described below

commit 067ba4b02e180ccd3f7e43f087698463d53a566e
Author: Jeffrey Vo <je...@gmail.com>
AuthorDate: Thu Apr 23 19:55:39 2026 +0900

    chore: add aggregation test for listview types (#21776)
    
    ## Which issue does this PR close?
    
    <!--
    We generally require a GitHub issue to be filed for all bug fixes and
    enhancements and this helps us generate change logs for our releases.
    You can link an issue to this PR using the GitHub syntax. For example
    `Closes #123` indicates that this PR will close issue #123.
    -->
    
    - Closes #19782
    
    ## Rationale for this change
    
    <!--
    Why are you proposing this change? If this is already explained clearly
    in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand
    your changes and offer better suggestions for fixes.
    -->
    
    We've landed various PRs required to support aggregating on list views
    (both upstream in arrow-rs and here in datafusion) so now this simple
    aggregation test succeeds; adding it to the slt suite.
    
    ## What changes are included in this PR?
    
    <!--
    There is no need to duplicate the description in the issue here but it
    is sometimes worth providing a summary of the individual changes in this
    PR.
    -->
    
    Add aggregation test for listviews
    
    ## Are these changes tested?
    
    <!--
    We typically require tests for all PRs in order to:
    1. Prevent the code from being accidentally broken by subsequent changes
    2. Serve as another way to document the expected behavior of the code
    
    If tests are not included in your PR, please explain why (for example,
    are they covered by existing tests)?
    -->
    
    Yes
    
    ## Are there any user-facing changes?
    
    <!--
    If there are user-facing changes then we may require documentation to be
    updated before approving the PR.
    -->
    
    No
    
    <!--
    If there are any breaking changes to public APIs, please add the `api
    change` label.
    -->
---
 datafusion/sqllogictest/test_files/list_view.slt | 66 ++++++++++++++++++++++++
 1 file changed, 66 insertions(+)

diff --git a/datafusion/sqllogictest/test_files/list_view.slt b/datafusion/sqllogictest/test_files/list_view.slt
new file mode 100644
index 0000000000..0e0fe817f6
--- /dev/null
+++ b/datafusion/sqllogictest/test_files/list_view.slt
@@ -0,0 +1,66 @@
+# 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.
+
+#############
+## ListView Aggregation Tests
+#############
+
+### Setup: Create test tables with ListView arrays
+
+statement ok
+CREATE TABLE list_view_agg_test AS
+SELECT
+    id,
+    group_col,
+    arrow_cast(make_array(val1, val2, val3), 'ListView(Int64)') as list_view_col,
+    arrow_cast(make_array(val1, val2, val3), 'LargeListView(Int64)') as large_list_view_col
+FROM (VALUES
+    (1, 'A', 10, 20, 30),
+    (2, 'A', 40, 50, 60),
+    (3, 'B', 70, 80, 90),
+    (4, 'B', 100, 110, 120),
+    (5, 'C', 1, 2, 3)
+) AS t(id, group_col, val1, val2, val3);
+
+### Test: GROUP BY on ListView column
+
+query ?I rowsort
+SELECT list_view_col, COUNT(*)
+FROM list_view_agg_test
+GROUP BY list_view_col;
+----
+[1, 2, 3] 1
+[10, 20, 30] 1
+[100, 110, 120] 1
+[40, 50, 60] 1
+[70, 80, 90] 1
+
+query ?I rowsort
+SELECT large_list_view_col, COUNT(*)
+FROM list_view_agg_test
+GROUP BY large_list_view_col;
+----
+[1, 2, 3] 1
+[10, 20, 30] 1
+[100, 110, 120] 1
+[40, 50, 60] 1
+[70, 80, 90] 1
+
+### Cleanup
+
+statement ok
+DROP TABLE list_view_agg_test;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org