You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Chenliang Xu (JIRA)" <ji...@apache.org> on 2016/09/28 00:20:20 UTC
[jira] [Comment Edited] (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=15527887#comment-15527887 ]
Chenliang Xu edited comment on SPARK-17694 at 9/28/16 12:20 AM:
----------------------------------------------------------------
It returns a DataSet, for example {noformat} DataSet[FooType] {noformat}
And then the returned value should behave as a DataSet of FooType, while it doesn't. The later step of transformation such as {{union}}, may fail because the DataSet has more than expected columns.
Consider the following code, the third line should never fail, since we know {{ds00}} and {{ds01}} have the same DataSet type.
{code}
val ds00 = df00.as[FooType]
val ds01 = df01.as[FooType]
ds00.union(ds010)
{code}
was (Author: luckyrand@gmail.com):
It returns a DataSet, for example {noformat} DataSet[FooType] {noformat}
And then the returned value should behave as a DataSet of FooType, while it doesn't. The later step of transformation such as {{union}}, may fail because the DataSet has more than expected columns.
Consider the following code, the third line should never fail, since we know {{ds00}} and {{ds01}} have the same DataSet type.
{code}
val ds00 = df00.as[FooType]
val ds01 = df01.as[FooType]
ds00.join(ds010)
{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
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org