spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Apache Spark (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (SPARK-15722) Wrong data when CTAS specifies schema
Date Thu, 02 Jun 2016 01:07:59 GMT

     [ https://issues.apache.org/jira/browse/SPARK-15722?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Apache Spark reassigned SPARK-15722:
------------------------------------

    Assignee: Andrew Or  (was: Apache Spark)

> Wrong data when CTAS specifies schema
> -------------------------------------
>
>                 Key: SPARK-15722
>                 URL: https://issues.apache.org/jira/browse/SPARK-15722
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 2.0.0
>            Reporter: Andrew Or
>            Assignee: Andrew Or
>
> {code}
> scala> sql("CREATE TABLE boxes (width INT, length INT, height INT) USING CSV")
> scala> (1 to 3).map { i => (i, i * 2, i * 3) }.toDF("height", "length", "width").write.insertInto("boxes")
> scala> spark.table("boxes").show()
> +-----+------+------+
> |width|length|height|
> +-----+------+------+
> |    1|     2|     3|
> |    2|     4|     6|
> |    3|     6|     9|
> +-----+------+------+
> scala> sql("CREATE TABLE blocks (name STRING, age INT) AS SELECT * FROM boxes")
> scala> spark.table("students").show()
> +----+---+
> |name|age|
> +----+---+
> |   1|  2|
> |   2|  4|
> |   3|  6|
> +----+---+
> {code}
> The columns don't even match in types.



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


Mime
View raw message