[
https://issues.apache.org/jira/browse/SPARK-5603?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Patrick Wendell updated SPARK-5603:
-----------------------------------
Assignee: Yin Huai
> 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
> Assignee: 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: [email protected]
For additional commands, e-mail: [email protected]