You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (JIRA)" <ji...@apache.org> on 2015/02/05 00:27:35 UTC
[jira] [Commented] (SPARK-5603) Preinsert casting and renaming rule
is needed in the Analyzer
[ https://issues.apache.org/jira/browse/SPARK-5603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14306205#comment-14306205 ]
Apache Spark commented on SPARK-5603:
-------------------------------------
User 'yhuai' has created a pull request for this issue:
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
>
> 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-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org