kosiew commented on code in PR #26031:
URL: https://github.com/apache/datafusion/pull/26031#discussion_r4346289000


##########
datafusion/sqllogictest/test_files/topk_dynamic_filter_remap.slt:
##########
@@ -0,0 +1,51 @@
+# 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
+SET datafusion.execution.target_partitions = 1;
+
+statement ok
+SET datafusion.execution.parquet.pushdown_filters = true;
+
+statement ok
+COPY (
+  SELECT value AS b FROM generate_series(0, 31999)
+) TO 'test_files/scratch/topk_dynamic_filter_remap.parquet'
+STORED AS PARQUET OPTIONS ('format.max_row_group_size' '500');
+
+statement ok
+CREATE EXTERNAL TABLE t STORED AS PARQUET
+LOCATION 'test_files/scratch/topk_dynamic_filter_remap.parquet';
+
+query I

Review Comment:
   Consider adding an EXPLAIN assertion confirming that the TopK dynamic filter 
reaches the Parquet scan. The result assertion could also pass with dynamic 
filtering disabled, so this would guard against planner changes bypassing the 
intended path while retaining the runtime result check.



##########
datafusion/sqllogictest/test_files/topk_dynamic_filter_remap.slt:
##########
@@ -0,0 +1,51 @@
+# 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
+SET datafusion.execution.target_partitions = 1;
+
+statement ok
+SET datafusion.execution.parquet.pushdown_filters = true;
+
+statement ok
+COPY (
+  SELECT value AS b FROM generate_series(0, 31999)
+) TO 'test_files/scratch/topk_dynamic_filter_remap.parquet'
+STORED AS PARQUET OPTIONS ('format.max_row_group_size' '500');
+
+statement ok
+CREATE EXTERNAL TABLE t STORED AS PARQUET
+LOCATION 'test_files/scratch/topk_dynamic_filter_remap.parquet';
+
+query I
+WITH s AS (SELECT b, 31999 - b AS p, 31999 - b AS q FROM t)

Review Comment:
   Could you add a short comment explaining that the CASE sort key contains the 
second sort key (`b`), making child-first remapping problematic? The equal 
`p`/`q` expressions simplify expected results, while multiple Parquet row 
groups provide later scan input for updated TopK filtering.



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