You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "Greg Rahn (JIRA)" <ji...@apache.org> on 2019/01/08 00:36:00 UTC

[jira] [Updated] (IMPALA-8054) Implicit cast fails with {const INT} BETWEEN FLOAT and INT

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

Greg Rahn updated IMPALA-8054:
------------------------------
    Description: 
In the following query the literal number 10 needs to be compared to two different types: INT and FLOAT, but Impala fails to make the implicit cast for the FLOAT. 

The predicates should be
{noformat}
predicates: (cast(10 as float) >= col4) AND (10 <= col3)
{noformat}

*Test case:*
{noformat}
sql> describe tab4
+------+--------+---------+
| name | type   | comment |
+------+--------+---------+
| pk   | int    |         |
| col0 | int    |         |
| col1 | float  |         |
| col2 | string |         |
| col3 | int    |         |
| col4 | float  |         |
| col5 | string |         |
+------+--------+---------+

sql> SELECT col0 FROM tab4 WHERE 10 BETWEEN col4 AND col3;
ERROR: IllegalStateException: child 0 type: FLOAT child 1 type: DOUBLE
{noformat}

  was:
In the following query the literal number 10 needs to be compared to two different types: INT and FLOAT, but Impala fails to make the implicit cast for the FLOAD. 

The predicates should be
{noformat}
predicates: (cast(10 as float) >= col4) AND (10 <= col3)
{noformat}

*Test case:*
{noformat}
sql> describe tab4
+------+--------+---------+
| name | type   | comment |
+------+--------+---------+
| pk   | int    |         |
| col0 | int    |         |
| col1 | float  |         |
| col2 | string |         |
| col3 | int    |         |
| col4 | float  |         |
| col5 | string |         |
+------+--------+---------+

sql> SELECT col0 FROM tab4 WHERE 10 BETWEEN col4 AND col3;
ERROR: IllegalStateException: child 0 type: FLOAT child 1 type: DOUBLE
{noformat}


> Implicit cast fails with {const INT} BETWEEN FLOAT and INT
> ----------------------------------------------------------
>
>                 Key: IMPALA-8054
>                 URL: https://issues.apache.org/jira/browse/IMPALA-8054
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Frontend
>    Affects Versions: Impala 3.2.0
>            Reporter: Greg Rahn
>            Assignee: Paul Rogers
>            Priority: Major
>
> In the following query the literal number 10 needs to be compared to two different types: INT and FLOAT, but Impala fails to make the implicit cast for the FLOAT. 
> The predicates should be
> {noformat}
> predicates: (cast(10 as float) >= col4) AND (10 <= col3)
> {noformat}
> *Test case:*
> {noformat}
> sql> describe tab4
> +------+--------+---------+
> | name | type   | comment |
> +------+--------+---------+
> | pk   | int    |         |
> | col0 | int    |         |
> | col1 | float  |         |
> | col2 | string |         |
> | col3 | int    |         |
> | col4 | float  |         |
> | col5 | string |         |
> +------+--------+---------+
> sql> SELECT col0 FROM tab4 WHERE 10 BETWEEN col4 AND col3;
> ERROR: IllegalStateException: child 0 type: FLOAT child 1 type: DOUBLE
> {noformat}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org