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 2016/08/08 11:26:20 UTC

[jira] [Commented] (SPARK-16947) Improve type coercion of inline tables

    [ https://issues.apache.org/jira/browse/SPARK-16947?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15411686#comment-15411686 ] 

Apache Spark commented on SPARK-16947:
--------------------------------------

User 'hvanhovell' has created a pull request for this issue:
https://github.com/apache/spark/pull/14539

> Improve type coercion of inline tables
> --------------------------------------
>
>                 Key: SPARK-16947
>                 URL: https://issues.apache.org/jira/browse/SPARK-16947
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 2.1.0
>            Reporter: Herman van Hovell
>            Assignee: Herman van Hovell
>
> Inline tables were added in to Spark SQL in 2.0, e.g.: {{select * from values (1, 'A'), (2, 'B') as tbl(a, b)}}
> This is currently implemented using a {{LocalRelation}} and this relation is created during parsing. This has several weaknesses: you can only use simple expressions in such a plan, and type coercion is based on the first row in the relation, and all subsequent values are cast in to this type. The latter violates the principle of least surprise.
> I would like to rewrite this into a union of projects; each of these projects would contain a single table row. We apply better type coercion rules to a union, and we should be able to rewrite this into a local relation during optimization. 



--
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