[
https://issues.apache.org/jira/browse/CALCITE-2930?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ruben Quesada Lopez updated CALCITE-2930:
-----------------------------------------
Description:
FilterCorrelateRule#onMatch method executes the following:
{code:java}
public void onMatch(RelOptRuleCall call) {
final Filter filter = call.rel(0);
final Correlate corr = call.rel(1);
...
RelOptUtil.classifyFilters(
corr,
aboveFilters,
JoinRelType.INNER,
false,
!corr.getJoinType().toJoinType().generatesNullsOnLeft(), // *** HERE!
!corr.getJoinType().toJoinType().generatesNullsOnRight(), // *** HERE!
aboveFilters,
leftFilters,
rightFilters);
...
{code}
If the Correlate object has SemiJoinType SEMI (or ANTI), the
{{corr.getJoinType().toJoinType()}} will throw a IllegalStateException:
{code}
Caused by: java.lang.IllegalStateException: Unable to convert SEMI to
JoinRelType
at org.apache.calcite.sql.SemiJoinType.toJoinType(SemiJoinType.java:83)
at
org.apache.calcite.rel.rules.FilterCorrelateRule.onMatch(FilterCorrelateRule.java:89)
at
org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:205)
{code}
was:
FilterCorrelateRule#onMatch method executes the following:
{code:java}
public void onMatch(RelOptRuleCall call) {
final Filter filter = call.rel(0);
final Correlate corr = call.rel(1);
...
RelOptUtil.classifyFilters(
corr,
aboveFilters,
JoinRelType.INNER,
false,
!corr.getJoinType().toJoinType().generatesNullsOnLeft(),
!corr.getJoinType().toJoinType().generatesNullsOnRight(),
aboveFilters,
leftFilters,
rightFilters);
...
{code}
If the Correlate object has SemiJoinType SEMI (or ANTI), the
{{corr.getJoinType().toJoinType()}} will throw a IllegalStateException:
{code}
Caused by: java.lang.IllegalStateException: Unable to convert SEMI to
JoinRelType
at org.apache.calcite.sql.SemiJoinType.toJoinType(SemiJoinType.java:83)
at
org.apache.calcite.rel.rules.FilterCorrelateRule.onMatch(FilterCorrelateRule.java:89)
at
org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:205)
{code}
> FilterCorrelateRule on a Correlate with SemiJoinType SEMI (or ANTI) throws
> IllegalStateException
> ------------------------------------------------------------------------------------------------
>
> Key: CALCITE-2930
> URL: https://issues.apache.org/jira/browse/CALCITE-2930
> Project: Calcite
> Issue Type: Bug
> Reporter: Ruben Quesada Lopez
> Assignee: Ruben Quesada Lopez
> Priority: Major
> Labels: pull-request-available
> Time Spent: 10m
> Remaining Estimate: 0h
>
> FilterCorrelateRule#onMatch method executes the following:
> {code:java}
> public void onMatch(RelOptRuleCall call) {
> final Filter filter = call.rel(0);
> final Correlate corr = call.rel(1);
> ...
> RelOptUtil.classifyFilters(
> corr,
> aboveFilters,
> JoinRelType.INNER,
> false,
> !corr.getJoinType().toJoinType().generatesNullsOnLeft(), // *** HERE!
> !corr.getJoinType().toJoinType().generatesNullsOnRight(), // *** HERE!
> aboveFilters,
> leftFilters,
> rightFilters);
> ...
> {code}
> If the Correlate object has SemiJoinType SEMI (or ANTI), the
> {{corr.getJoinType().toJoinType()}} will throw a IllegalStateException:
> {code}
> Caused by: java.lang.IllegalStateException: Unable to convert SEMI to
> JoinRelType
> at org.apache.calcite.sql.SemiJoinType.toJoinType(SemiJoinType.java:83)
> at
> org.apache.calcite.rel.rules.FilterCorrelateRule.onMatch(FilterCorrelateRule.java:89)
> at
> org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:205)
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)