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 "Daniel Becker (Jira)" <ji...@apache.org> on 2022/10/11 12:08:00 UTC

[jira] [Commented] (IMPALA-11462) shiftleft problem

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

Daniel Becker commented on IMPALA-11462:
----------------------------------------

Steps to reproduce:

With literal second argument the query works as expected:
{code:java}
select shiftleft(cast(1 as bigint), 7);
+---------------------------------+
| shiftleft(cast(1 as bigint), 7) |
+---------------------------------+
| 128                             |
+---------------------------------+{code}
With non-literal second argument overflow occurs:
{code:java}
select shiftleft(cast(1 as bigint), z) c from (select 7 z ) x;
+------+
| c    |
+------+
| -128 |
+------+{code}
However, if we disable expression rewriting, it works with a non-literal second argument, too:
{code:java}
set ENABLE_EXPR_REWRITES=0;
select shiftleft(cast(1 as bigint), z) c from (select 7 z ) x;
+-----+
| c   |
+-----+
| 128 |
+-----+{code}

> shiftleft problem
> -----------------
>
>                 Key: IMPALA-11462
>                 URL: https://issues.apache.org/jira/browse/IMPALA-11462
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Clients
>    Affects Versions: Impala 3.4.1
>            Reporter: jack sun
>            Assignee: Daniel Becker
>            Priority: Minor
>         Attachments: screenshot-1.png
>
>
> if change the second param of function 'shiftleft' as a dynamic value , it will change the first param as tinnyint
>  !screenshot-1.png! 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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