[ 
https://issues.apache.org/jira/browse/HIVE-15098?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Chao Sun updated HIVE-15098:
----------------------------
    Description: 
For the following simple (yet nonsense) query:
{code}
SELECT  DISTINCT 
    UNIX_TIMESTAMP('2016-10-02','yyyy-mm-dd') AS col1,
    UNIX_TIMESTAMP('2016-10-02','yyyy-MM-dd') AS col2
FROM 
    default.dummy;
{code}

With CBO, this generate correct results:
{code}
+-------------+-------------+
|    col1     |    col2     |
+-------------+-------------+
| 1451722200  | 1475391600  |
+-------------+-------------+
{code}

However, if CBO is turned off, the result no longer make sense:
{code}
+-------+-------+
| col1  | col2  |
+-------+-------+
| NULL  | NULL  |
+-------+-------+
{code}

  was:
For the following simple query:
{code}
SELECT  DISTINCT 
    UNIX_TIMESTAMP('2016-10-02','yyyy-mm-dd') AS col1,
    UNIX_TIMESTAMP('2016-10-02','yyyy-MM-dd') AS col2
FROM 
    default.dummy;
{code}

With CBO, this generate correct results:
{code}
+-------------+-------------+
|    col1     |    col2     |
+-------------+-------------+
| 1451722200  | 1475391600  |
+-------------+-------------+
{code}

However, if CBO is turned off, the result no longer make sense:
{code}
+-------+-------+
| col1  | col2  |
+-------+-------+
| NULL  | NULL  |
+-------+-------+
{code}


> SELECT DISTINCT w/o CBO produces incorrect results
> --------------------------------------------------
>
>                 Key: HIVE-15098
>                 URL: https://issues.apache.org/jira/browse/HIVE-15098
>             Project: Hive
>          Issue Type: Bug
>          Components: Query Planning
>            Reporter: Chao Sun
>
> For the following simple (yet nonsense) query:
> {code}
> SELECT  DISTINCT 
>     UNIX_TIMESTAMP('2016-10-02','yyyy-mm-dd') AS col1,
>     UNIX_TIMESTAMP('2016-10-02','yyyy-MM-dd') AS col2
> FROM 
>     default.dummy;
> {code}
> With CBO, this generate correct results:
> {code}
> +-------------+-------------+
> |    col1     |    col2     |
> +-------------+-------------+
> | 1451722200  | 1475391600  |
> +-------------+-------------+
> {code}
> However, if CBO is turned off, the result no longer make sense:
> {code}
> +-------+-------+
> | col1  | col2  |
> +-------+-------+
> | NULL  | NULL  |
> +-------+-------+
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to