Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.1.0
-
None
-
None
-
Hive 2.1
Description
Create or Replace a view with different column types may fail with error :
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Unable to alter table. The following columns have types incompatible with the existing columns in their respective positions :
i
Here is minimum reproduce:
CREATE TABLE testtype(i int, s1 string); DDL1: create or replace view v1 (s1) as Select s1 from testtype; DDL2: create or replace view v1 (i,s1) as Select i, s1 from testtype ; FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Unable to alter table. The following columns have types incompatible with the existing columns in their respective positions : i
Only Workaround is:
To drop the view and Create view again.
We should allow "Create or Replace View" to work even if the column types are different.
It should work like "Drop View" and then "Create a View".