You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Paweł Batko (JIRA)" <ji...@apache.org> on 2018/07/09 17:45:00 UTC
[jira] [Commented] (SPARK-17694) convert DataFrame to DataSet
should check columns match
[ https://issues.apache.org/jira/browse/SPARK-17694?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16537320#comment-16537320 ]
Paweł Batko commented on SPARK-17694:
-------------------------------------
Another minimal:
{code:scala}
case class Foo(a: String, b: String)
case class Bar(a: String)
val foos = Seq(Foo("1", "2")).toDS()
val bars: Dataset[Bar] = foos.as[Bar] // fine
val foos2: Dataset[Foo] = bars.as[Foo] // executes fine, but I think it should fail, because Bar doesn't have field 'b'
{code}
> convert DataFrame to DataSet should check columns match
> -------------------------------------------------------
>
> Key: SPARK-17694
> URL: https://issues.apache.org/jira/browse/SPARK-17694
> Project: Spark
> Issue Type: Improvement
> Components: SQL
> Affects Versions: 1.6.1, 1.6.2
> Reporter: Chenliang Xu
> Priority: Minor
>
> The {{as}} method, which converts a DataFrame to DataSet requires the user to ensure the columns are match. And it success even the columns do not match, and cause error at later steps.
> It would be better, to let {{as}} match the columns, and fail/warn when the match fails.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org