You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2018/09/30 17:27:00 UTC

[jira] [Commented] (CALCITE-2326) Generalize p(x) IS TRUE/FALSE/UNKNOWN handling in RexSimplify

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

Julian Hyde commented on CALCITE-2326:
--------------------------------------

I have done the re-factoring in https://github.com/julianhyde/calcite/tree/2326-simplify-unknown-as. It is several messy commits right now, but the key changes are there:
* Add enum RexUnknownAs with values TRUE, FALSE, UNKNOWN. UNKNOWN means "as is", FALSE is the previous unknownAsFalse behavior, and TRUE is new.
* In {{RexSimplify}} add an {{unknownAs}} argument to {{simplify}}, {{simplifyAnd}} and {{simplifyAnds}}, {{simplifyFilterPredicates}} methods. The previous methods are deprecated.
* Deprecate the {{RexSimplify}} constructor that passes {{unknownAsFalse}}, but if people use it, it still works. The value of the {{unknownAsFalse}} becomes a field that is the default value for the {{unknownAs}} parameter to the deprecated {{simplify}}, {{simplifyAnd}}, {{simplifyAnds}}, {{simplifyFilterPredicates}} methods that do not have an {{unknownAs}} parameter.
* Add test helper method {{checkSimplify3}} that checks simplification for unknownAs UNKNOWN, FALSE, TRUE. {{checkSimplify2}} calls it, assuming that the result for TRUE is the same as UNKNOWN.

[~vlsi], [~kgyrtkirk], [~jcamachorodriguez], Can you please review? It is not perfect, but it is progress. I am prepared to make cleanups and accept constructive criticism but I will be extremely dismayed if this change receives a -1.

> Generalize p(x) IS TRUE/FALSE/UNKNOWN handling in RexSimplify
> -------------------------------------------------------------
>
>                 Key: CALCITE-2326
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2326
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Zoltan Haindrich
>            Assignee: Zoltan Haindrich
>            Priority: Major
>
> Currently only IS TRUE is handle by the unknownAsFalse field variable.
> The main goal would be to extend the logic to also handle IS FALSE cases (and possibly IS UNKNOWN too)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)