[
https://issues.apache.org/jira/browse/CALCITE-2617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16648976#comment-16648976
]
Stamatis Zampetakis commented on CALCITE-2617:
----------------------------------------------
[~julianhyde]
{quote}
I think that we should make it configurable via a Predicate in the constructor.
Not via a command-line -D argument.
{quote}
The rule should be configurable by a Predicate in the constructor as it is now
in the PR. The -D argument could be used (without any strong preference) to
make configurable the default rule set used by calcite (as it happens for
example in
https://github.com/apache/calcite/blob/fb7914ec61fc57c8348d9da144e2fbd608c00c61/core/src/main/java/org/apache/calcite/tools/Programs.java#L126).
{quote}
If we make the new behavior more aggressive (i.e. push down even if there are
correlating variables), are there any regressions?
{quote}
There are failures in SqlToRelConverterTest for example. I suppose because the
decorrelator cannot find the same pattern as before. Otherwise I would agree
that more aggressive is always better.
{quote}
I don't see any need for a new constructor (especially one with no javadoc)
comments.
{quote}
Without the new constructor if a client wants to create a
FilterProjectTransposeRule to push (or not push) with correlated variables or
apply an additional/different Predicate he will be obliged to create a subclass
and use the protected constructor. Other than that I admit that javadoc should
be added.
{quote}
I don't think see a need for HAS_CORRELATION to be a field (especially when its
javadoc comment is the opposite of what it actually does). Just use a lambda
expression.
{quote}
It exists in order not to repeat the javadoc explanation (which I found useful)
+ lamda expression in multiple places. But since you find it confusing, I don't
mind removing it.
> FilterProjectTransposeRule should allow filter conditions with correlated
> variables to be pushed down
> -----------------------------------------------------------------------------------------------------
>
> Key: CALCITE-2617
> URL: https://issues.apache.org/jira/browse/CALCITE-2617
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Affects Versions: 1.17.0
> Reporter: Stamatis Zampetakis
> Assignee: Julian Hyde
> Priority: Major
> Fix For: 1.18.0
>
>
> The rule always forbids conditions with correlated variables to be pushed
> down (as of [CALCITE-769|https://issues.apache.org/jira/browse/CALCITE-769]
> to avoid certain problems in the decorrelation of the query). However, in the
> general context of query optimization, it is beneficial to push-down filters
> and the fact that there is a correlated variable is not a reason to skip this
> optimization.
> In order to avoid regressions, and at the same time enable correlated
> conditions to be pushed down we should make the pushing of correlated
> variables configurable.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)