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

mbudiu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/calcite.git

commit f14e944477674d987b91a4edacadb58c759eb74d
Author: suibianwanwan <[email protected]>
AuthorDate: Mon Oct 7 16:36:38 2024 +0800

    [CALCITE-6615] BindableTableScan estimateRowCount does not calculate push 
down filters
---
 core/src/main/java/org/apache/calcite/interpreter/Bindables.java | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/core/src/main/java/org/apache/calcite/interpreter/Bindables.java 
b/core/src/main/java/org/apache/calcite/interpreter/Bindables.java
index 069a2cade4..f3a4d22ba1 100644
--- a/core/src/main/java/org/apache/calcite/interpreter/Bindables.java
+++ b/core/src/main/java/org/apache/calcite/interpreter/Bindables.java
@@ -269,6 +269,11 @@ public class Bindables {
           .itemIf("projects", projects, !projects.equals(identity()));
     }
 
+    @Override public double estimateRowCount(RelMetadataQuery mq) {
+      double f = filters.isEmpty() ? 1d : 0.5d;
+      return super.estimateRowCount(mq) * f;
+    }
+
     @Override public @Nullable RelOptCost computeSelfCost(RelOptPlanner 
planner,
         RelMetadataQuery mq) {
       boolean noPushing = filters.isEmpty()

Reply via email to