Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
0.6.0
-
None
-
None
Description
Consider
CREATE TABLE t(i INT);
CREATE VIEW v AS SELECT i FROM t;
ALTER TABLE t REPLACE COLUMNS (i STRING);
SELECT i FROM v;
What will be the result type for i in the final SELECT?
Consensus at code review was that it should be INT (not STRING) since the CREATE VIEW is supposed to freeze the metadata for the view's result schema. Note that SQL:2008 ALTER COLUMN SET DATA TYPE doesn't cover this case, because it doesn't support changing the datatype family. For this case, MySQL produces VARCHAR rather than INT, and (consistently) DESCRIBE v and INFORMATION_SCHEMA show VARCHAR as well, so either they are propagating the type change in the catalog, or dynamically re-deriving it.
Attachments
Issue Links
- relates to
-
HIVE-972 Support views
- Closed