CREATE VIEW followup:  impose casts on view result columns if underlying column 
types change
--------------------------------------------------------------------------------------------

                 Key: HIVE-1067
                 URL: https://issues.apache.org/jira/browse/HIVE-1067
             Project: Hadoop Hive
          Issue Type: Improvement
          Components: Query Processor
    Affects Versions: 0.6.0
            Reporter: John Sichi
            Assignee: John Sichi
             Fix For: 0.6.0


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.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to