Hi,
I was wondering if there exist any rules to duplicate filters which exist above
the join, whose effect is dependent on the result of the join and therefore
cannot be *pushed* below a join, but could be *duplicated* below the join.
For example: `select … from A LEFT join B on … where B.field
Hey Ian,
I don't think there is such a rule in Calcite but you may find similar
ideas in rules present in other projects.
In Hive for instance, there is the HivePreFilteringRule [1, 2] that
pushes "redundantly" some filters below other operations in the tree.
What is inherently problematic with a
I like the idea of redundant filters. We should probably add a new kind of
metadata so that one node can see that a filter is redundant. I’m not sure how
that metadata would look. A well chosen use case will help us design it. Does
anyone have one?
> On Sep 27, 2023, at 1:40 AM, Stamatis Zampet
Thanks, Ian. That’s useful.
My concern with duplication of filter conditions is that we give the lower
relational expression permission to ignore them. Suppose we have a query (Q1):
select *
from emp
left join dept
using (deptno)
where myPredicate(dept.dname)
We could duplicate th
In the Trino,there are two kinds of predicates if the predicates could be
pushed: 1. unenforced predicate 2. enforced predicate unenforced predicate
means that a predicate could be pushed down, but the bottom layer will not
guarantee that the data completely conforms to the predicate, so we still
n
Hi Stamatis,
Thanks for pointing out those rules.
Unfortunately, I think my initial premise was wrong.
Thanks!
-Ian
(elaborating mostly for future readers)
For example, say I have these two tables:
T1
| Id | ForeignKey
| 1 | 10
| 2 | 20
| 3 | 30
| 4 | 40
T2
| Id | SomeValue
| 10 | 123
| 20