You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Haisheng Yuan (Jira)" <ji...@apache.org> on 2019/11/18 19:51:00 UTC
[jira] [Commented] (CALCITE-3492) RexUtil.simplifyOrs() throws
exception if terms has 1 RexNode
[ https://issues.apache.org/jira/browse/CALCITE-3492?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16976839#comment-16976839 ]
Haisheng Yuan commented on CALCITE-3492:
----------------------------------------
Thanks for pointing out. I have changed the title accordingly.
> RexUtil.simplifyOrs() throws exception if terms has 1 RexNode
> -------------------------------------------------------------
>
> Key: CALCITE-3492
> URL: https://issues.apache.org/jira/browse/CALCITE-3492
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Reporter: Haisheng Yuan
> Priority: Major
> Labels: pull-request-available
> Time Spent: 10m
> Remaining Estimate: 0h
>
> This is a regression caused by the refactoring in 1.20.0.
> When {{terms}} has only 1 element, it will throw an exception. We discovered the issue when trying to upgrade Calcite.
> {code:java}
> public static RexNode simplifyOrs(RexBuilder rexBuilder,
> List<RexNode> terms) {
> return new RexSimplify(rexBuilder, RelOptPredicateList.EMPTY, EXECUTOR)
> .simplifyUnknownAs(rexBuilder.makeCall(SqlStdOperatorTable.OR, terms),
> RexUnknownAs.UNKNOWN);
> }
> {code}
> We can't assume the {{terms}} always has more than 1 element. Although this method is deprecated, I think we need to correct the regression. Maybe we don't need a test case, given it is a deprecated method.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)