viirya edited a comment on issue #25570: [SPARK-23519][SQL] create view should 
work from query with duplicate output columns
URL: https://github.com/apache/spark/pull/25570#issuecomment-524844659
 
 
   hmm I am not sure if ALTER VIEW AS should take the schema of the new query, 
or it should keep original schema, and just replace old query?
   
   That's right, you described is what ALTER VIEW AS works now. Hive's document 
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-AlterViewAsSelect,
 doesn't talk the details, just says it works as CREATE OR REPLACE VIEW. But I 
can't find Hive doc of CREATE OR REPLACE VIEW.
   
   The comment `Nothing we need to retain from the old view...`, is specific 
for CREATE OR REPLACE VIEW. I think it does not necessarily indicate how ALTER 
VIEW AS works.
   
   Postgresql has CREATE OR REPLACE VIEW, but interestingly, the new query in 
CREATE OR REPLACE VIEW must generate same column names in the same order and 
data types. No ALTER VIEW AS in Postgresql.
   
   I thought ALTER VIEW AS only replaces old query, and keeps original schema. 
But seems it isn't how ALTER VIEW AS works now.
   
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to