You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enable dynamic filtering in etc/config.properties:
enable-dynamic-filtering=true
Alternatively, start the server and enable it for the session:
SET SESSION enable_dynamic_filtering = true;
Start the Presto server.
Create an Iceberg table:
CREATE TABLE iceberg.iceberg.my_table (id int);
Insert two rows:
INSERT INTO iceberg.iceberg.my_table VALUES(1), (2);
Execute the following query:
SELECT id
FROM iceberg.iceberg.my_table
WHERE id <= (SELECT count(*) FROM iceberg.iceberg.my_table);
The query fails during query planning with:
java.lang.IllegalArgumentException: Right join input doesn't contain symbol for dynamic filter: count, rightVariables: [], dynamicFilters.values(): [count]
The query should execute successfully and return the expected result.
Current Behavior
When dynamic filtering is enabled, the query fails during logical plan optimization with the following exception:
java.lang.IllegalArgumentException: Right join input doesn't contain symbol for dynamic filter: count, rightVariables: [], dynamicFilters.values(): [count]
at com.facebook.presto.common.Utils.checkArgument(Utils.java:60)
at com.facebook.presto.spi.plan.JoinNode.<init>(JoinNode.java:149)
at com.facebook.presto.sql.planner.optimizations.PruneUnreferencedOutputs$Rewriter.visitJoin(PruneUnreferencedOutputs.java:264)
at com.facebook.presto.sql.planner.optimizations.PruneUnreferencedOutputs$Rewriter.visitJoin(PruneUnreferencedOutputs.java:129)
at com.facebook.presto.spi.plan.JoinNode.accept(JoinNode.java:322)
at com.facebook.presto.sql.planner.plan.SimplePlanRewriter$RewriteContext.rewrite(SimplePlanRewriter.java:97)
at com.facebook.presto.sql.planner.optimizations.PruneUnreferencedOutputs$Rewriter.visitProject(PruneUnreferencedOutputs.java:737)
at com.facebook.presto.sql.planner.optimizations.PruneUnreferencedOutputs$Rewriter.visitProject(PruneUnreferencedOutputs.java:129)
at com.facebook.presto.spi.plan.ProjectNode.accept(ProjectNode.java:107)
at com.facebook.presto.sql.planner.plan.SimplePlanRewriter$RewriteContext.rewrite(SimplePlanRewriter.java:97)
at com.facebook.presto.sql.planner.optimizations.PruneUnreferencedOutputs$Rewriter.visitOutput(PruneUnreferencedOutputs.java:746)
at com.facebook.presto.sql.planner.optimizations.PruneUnreferencedOutputs$Rewriter.visitOutput(PruneUnreferencedOutputs.java:129)
at com.facebook.presto.spi.plan.OutputNode.accept(OutputNode.java:97)
at com.facebook.presto.sql.planner.plan.SimplePlanRewriter.rewriteWith(SimplePlanRewriter.java:35)
at com.facebook.presto.sql.planner.optimizations.PruneUnreferencedOutputs.optimize(PruneUnreferencedOutputs.java:125)
at com.facebook.presto.sql.Optimizer.validateAndOptimizePlan(Optimizer.java:114)
at com.facebook.presto.execution.SqlQueryExecution.lambda$doCreateLogicalPlanAndOptimize$1(SqlQueryExecution.java:603)
at com.facebook.presto.common.RuntimeStats.recordWallAndCpuTime(RuntimeStats.java:158)
at com.facebook.presto.execution.SqlQueryExecution.doCreateLogicalPlanAndOptimize(SqlQueryExecution.java:601)
at com.facebook.presto.common.RuntimeStats.recordWallAndCpuTime(RuntimeStats.java:158)
at com.facebook.presto.execution.SqlQueryExecution.createLogicalPlanAndOptimize(SqlQueryExecution.java:572)
at com.facebook.presto.execution.SqlQueryExecution.start(SqlQueryExecution.java:500)
at com.facebook.presto.$gen.Presto_null__testversion____20260817_162121_1.run(Unknown Source)
at com.facebook.presto.execution.SqlQueryManager.createQuery(SqlQueryManager.java:326)
at com.facebook.presto.dispatcher.LocalDispatchQuery.lambda$startExecution$0(LocalDispatchQuery.java:217)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)
Queries utilizing subqueries with aggregations (e.g., min() / max() / count()) against Iceberg tables fail during logical plan optimization.
The issue appears to be a regression introduced by the changes in #27085, since reverting those changes makes the problem disappear.
Disabling dynamic filtering provides a workaround, but this may have performance implications for workloads that rely on dynamic filtering.
Your Environment
masterbranch which include the changes from feat(plugin-iceberg): Push down min/max/count based on file stats #27085Steps to Reproduce
etc/config.properties:Alternatively, start the server and enable it for the session:
Expected Behavior
The query should execute successfully and return the expected result.
Current Behavior
When dynamic filtering is enabled, the query fails during logical plan optimization with the following exception: