You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Ruben Quesada Lopez (JIRA)" <ji...@apache.org> on 2019/03/19 16:21:00 UTC

[jira] [Comment Edited] (CALCITE-2930) FilterCorrelateRule on a Correlate with SemiJoinType SEMI (or ANTI) throws IllegalStateException

    [ https://issues.apache.org/jira/browse/CALCITE-2930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16796235#comment-16796235 ] 

Ruben Quesada Lopez edited comment on CALCITE-2930 at 3/19/19 4:20 PM:
-----------------------------------------------------------------------

[~krisden], I was not aware of that. I just created this issue yesterday, as soon as I reproduced it.
I think this is a trivial fix to prevent an exception from happening in a certain scenario (correlated SemiJoin) which will be more or less likely reproducible (specially with the implementation of CALCITE-2621 in 1.19.0). I believe it would be nice to have this fix in 1.19.0 too, if possible; otherwise we can plan it for the next version.


was (Author: rubenql):
[~krisden], I was not aware of that. I just created this issue yesterday, as soon as I reproduced it.
I think this is a trivial fix to prevent an exception from happening in a certain scenario (correlated SemiJoin) which will be more or less likely reproducible (specially with the implementation of CALCITE-2621 in 1.19.0). I believe it would be nice to have this fix in 1.19.0 too, if possible.

> 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
>    Affects Versions: 1.18.0
>            Reporter: Ruben Quesada Lopez
>            Assignee: Ruben Quesada Lopez
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.19.0
>
>          Time Spent: 40m
>  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)