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

Bikramjeet Vig commented on IMPALA-2566:
----------------------------------------

[~tarmstrong] seems like all cast functions are a part of the builtin DB and 
therefore all of them are exposed along with all other builtin functions. if we 
are supposed to hide this function, should we be doing this for all other cast* 
functions too?

> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to