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 "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2018/11/01 16:05:00 UTC

[jira] [Commented] (IMPALA-2566) Result of casttochar() not handled properly in SQL operations

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

ASF subversion and git services commented on IMPALA-2566:
---------------------------------------------------------

Commit 85526157bc87f129c9390a46b086f597714f3717 in impala's branch refs/heads/master from [~bikram.sngh91]
[ https://git-wip-us.apache.org/repos/asf?p=impala.git;h=8552615 ]

IMPALA-2566: Remove ability to access impala builtin cast functions
directly

Currently, all impala builtin cast functions are exposed to the user
and can be used directly in sql statements. These methods are used
internally for casting and sometimes require context not available
when used directly. This patch removes direct access to those methods
by throwing an analysis exception.

Testing:
Added relevant frontend tests.

Change-Id: I6f562607aaaf728fc417066565811bbd269baaa8
Reviewed-on: http://gerrit.cloudera.org:8080/11830
Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>


> Result of casttochar() not handled properly in SQL operations
> -------------------------------------------------------------
>
>                 Key: IMPALA-2566
>                 URL: https://issues.apache.org/jira/browse/IMPALA-2566
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Frontend
>    Affects Versions: Impala 2.3.0
>            Reporter: John Russell
>            Assignee: Bikramjeet Vig
>            Priority: Critical
>              Labels: crash
>
> If I use casttochar() during a CTAS to set the type of a column, Impala considers the result to be STRING. However, somehow the length information for the CHAR results must be getting passed back and messing things up in the output. Trying to query the resulting table causes the query to hang:
> {code}
> [blah:21000] > create table char_types as select casttochar('hello world') as c1, casttochar('xyz') as c2, casttochar('x') as c3;
> Query: create table char_types as select casttochar('hello world') as c1, casttochar('xyz') as c2, casttochar('x') as c3
> +-------------------+
> | summary           |
> +-------------------+
> | Inserted 1 row(s) |
> +-------------------+
> Fetched 1 row(s) in 6.89s
> [blah:21000] > desc char_types;
> Query: describe char_types
> +------+--------+---------+
> | name | type   | comment |
> +------+--------+---------+
> | c1   | string |         |
> | c2   | string |         |
> | c3   | string |         |
> +------+--------+---------+
> [blah:21000] > show functions in _impala_builtins like 'casttochar';
> Query: show functions in _impala_builtins like 'casttochar'
> +-------------+--------------------------+
> | return type | signature                |
> +-------------+--------------------------+
> | CHAR(*)     | casttochar(BIGINT)       |
> | CHAR(*)     | casttochar(BOOLEAN)      |
> | CHAR(*)     | casttochar(CHAR(*))      |
> | CHAR(*)     | casttochar(DECIMAL(*,*)) |
> | CHAR(*)     | casttochar(DOUBLE)       |
> | CHAR(*)     | casttochar(FLOAT)        |
> | CHAR(*)     | casttochar(INT)          |
> | CHAR(*)     | casttochar(SMALLINT)     |
> | CHAR(*)     | casttochar(STRING)       |
> | CHAR(*)     | casttochar(TIMESTAMP)    |
> | CHAR(*)     | casttochar(TINYINT)      |
> | CHAR(*)     | casttochar(VARCHAR(*))   |
> +-------------+--------------------------+
> Fetched 12 row(s) in 0.10s
> [blah:21000] > select * from char_types;
> Query: select * from char_types
> ^C Cancelling Query
> {code}
> The HDFS data file has the original text info plus extra control characters. Doing hdfs dfs -cat on the data file causes the OS X terminal to go haywire and lock up.



--
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