[ https://issues.apache.org/jira/browse/SPARK-5603?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Michael Armbrust resolved SPARK-5603. ------------------------------------- Resolution: Fixed Fix Version/s: 1.3.0 Issue resolved by pull request 4373 [https://github.com/apache/spark/pull/4373] > Preinsert casting and renaming rule is needed in the Analyzer > ------------------------------------------------------------- > > Key: SPARK-5603 > URL: https://issues.apache.org/jira/browse/SPARK-5603 > Project: Spark > Issue Type: Sub-task > Components: SQL > Reporter: Yin Huai > Priority: Blocker > Fix For: 1.3.0 > > > For an INSERT INTO/OVERWRITE statement, we should add necessary Cast and > Alias to the output of the query. > {code} > CREATE TEMPORARY TABLE jsonTable (a int, b string) > USING org.apache.spark.sql.json.DefaultSource > OPTIONS ( > path '...' > ) > INSERT OVERWRITE TABLE jsonTable SELECT a * 2, a * 4 FROM table > {code} > For a*2, we should create an Alias, so the InsertableRelation can know it is > the column a. For a*4, it is actually the column b in jsonTable. We should > first cast it to StringType and add an Alias b to it. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org