Pavel Grafkin created IMPALA-7045:
-------------------------------------
Summary: CTAS doesn't allow NULL values
Key: IMPALA-7045
URL: https://issues.apache.org/jira/browse/IMPALA-7045
Project: IMPALA
Issue Type: Bug
Environment: impalad version 2.7.0-cdh5.10.0 RELEASE (build
785a073cd07e2540d521ecebb8b38161ccbd2aa2)
Built on Fri Jan 20 12:03:56 PST 2017
Reporter: Pavel Grafkin
When I run following:
{{CREATE TABLE temp_test AS SELECT CAST(null AS bigint) as nullable_int }}
with the error:
{{Unsupported type 'null_type' in column 'nullable_int' of table 'temp_test'}}
The reason for this, I assume, is following. In the INSERT statements data
types of result set's columns are retrieved from the resulting values:
[https://github.com/apache/impala/blob/789c5aac23480acc6e18c057b767b65fdd791c97/fe/src/main/java/org/apache/impala/analysis/InsertStmt.java#L275]
Whereas in CTAS they are calculated via base table of the column (and there is
no base table for NULL):
[https://github.com/apache/impala/blob/ba84ad03cb83d7f7aed8524fcfbb0e2cdc9fdd53/fe/src/main/java/org/apache/impala/analysis/CreateTableAsSelectStmt.java#L171]
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)