You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Ashutosh Chauhan (JIRA)" <ji...@apache.org> on 2018/11/08 23:09:00 UTC

[jira] [Comment Edited] (HIVE-20881) Constant propagation oversimplifies projections

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

Ashutosh Chauhan edited comment on HIVE-20881 at 11/8/18 11:08 PM:
-------------------------------------------------------------------

For Sel we need to return NULL in such cases. However, for Filter operator we can still fold it to false, correct? But with this change we will return NULL in all cases. Can we return false for FIL ?


was (Author: ashutoshc):
For Sel we need to return in such cases. However, for Filter operator we can still fold it to false, correct? But with this change we will return NULL in all cases. Can we return false for FIL ?

> Constant propagation oversimplifies projections
> -----------------------------------------------
>
>                 Key: HIVE-20881
>                 URL: https://issues.apache.org/jira/browse/HIVE-20881
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Zoltan Haindrich
>            Assignee: Zoltan Haindrich
>            Priority: Major
>         Attachments: HIVE-20881.01.patch
>
>
> {code:java}
> create table cx2(bool1 boolean);
> insert into cx2 values (true),(false),(null);
> set hive.cbo.enable=true;
> select bool1 IS TRUE OR (cast(NULL as boolean) AND bool1 IS NOT TRUE AND bool1 IS NOT FALSE) from cx2;
> +--------+
> |  _c0   |
> +--------+
> | true   |
> | false  |
> | NULL   |
> +--------+
> set hive.cbo.enable=false;
> select bool1 IS TRUE OR (cast(NULL as boolean) AND bool1 IS NOT TRUE AND bool1 IS NOT FALSE) from cx2;
> +-------+
> |  _c0  |
> +-------+
> | true  |
> | NULL  |
> | NULL  |
> +-------+
> {code}
> from explain it seems the expression was simplified to: {{(_col0 is true or null)}}



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