Fredy Wijaya has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/12217 )

Change subject: IMPALA-7679: Improve error message when adding NULL column in 
CTAS, CREATE VIEW and ALTER VIEW
......................................................................


Patch Set 6:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/12217/2/fe/src/main/java/org/apache/impala/analysis/CreateTableAsSelectStmt.java
File fe/src/main/java/org/apache/impala/analysis/CreateTableAsSelectStmt.java:

http://gerrit.cloudera.org:8080/#/c/12217/2/fe/src/main/java/org/apache/impala/analysis/CreateTableAsSelectStmt.java@188
PS2, Line 188:       if (colDef.getType() == Type.NULL) {
> Hmm. While NULL is a valid type, I don't think a column definition with a N
I agree that NULL in ColumnDef doesn't seem to make sense and I can't think of 
any examples. However, putting the error message in ColumnDef that says 
something about not being able to infer the type and recommending to use cast() 
seems a bit too specific to certain statements. This is because there are many 
other statements that use ColumnDef, such as ALTER TABLE, CREATE TABLE, etc.

We could update ColumnDef.analyze() to throw an exception when the type is 
NULL. However, I still think some specific statements will need interpret the 
exception and re-throw the error with a more useful error message to give a 
better user experience.

Let me know your thoughts.



--
To view, visit http://gerrit.cloudera.org:8080/12217
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia2fe1fc96f0650477c0e897c010be3fadabfaf82
Gerrit-Change-Number: 12217
Gerrit-PatchSet: 6
Gerrit-Owner: Fredy Wijaya <[email protected]>
Gerrit-Reviewer: Bharath Vissapragada <[email protected]>
Gerrit-Reviewer: Fredy Wijaya <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Paul Rogers <[email protected]>
Gerrit-Reviewer: Tim Armstrong <[email protected]>
Gerrit-Comment-Date: Thu, 17 Jan 2019 20:11:09 +0000
Gerrit-HasComments: Yes

Reply via email to