Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-6475][SQL] recognize array types when infer data types from JavaBeans #5146

Closed
wants to merge 2 commits into from

Conversation

mengxr
Copy link
Contributor

@mengxr mengxr commented Mar 23, 2015

Right now if there is a array field in a JavaBean, the user wold see an exception in createDataFrame. @liancheng

@SparkQA
Copy link

SparkQA commented Mar 23, 2015

Test build #29035 has started for PR 5146 at commit 4f2df5e.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Mar 23, 2015

Test build #29035 has finished for PR 5146 at commit 4f2df5e.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/29035/
Test PASSed.

DataFrame df = context.createDataFrame(rdd, Bean.class);
Row first = df.select("a", "b").first();
Assert.assertEquals(bean.getA(), first.getDouble(0), 0.0);
Assert.assertArrayEquals(bean.getB(), first.<Integer[]>getAs(1));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be better to add assertions for schema field data types.

@liancheng
Copy link
Contributor

LGTM except for a minor comment about the test case.

@SparkQA
Copy link

SparkQA commented Mar 24, 2015

Test build #29058 has started for PR 5146 at commit 51e87e5.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Mar 24, 2015

Test build #29058 has finished for PR 5146 at commit 51e87e5.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/29058/
Test PASSed.

@mengxr
Copy link
Contributor Author

mengxr commented Mar 24, 2015

Merged into master.

@asfgit asfgit closed this in a1d1529 Mar 24, 2015
asfgit pushed a commit that referenced this pull request Apr 21, 2015
liancheng mengxr this is similar to #5146.

Author: Punya Biswal <pbiswal@palantir.com>

Closes #5578 from punya/feature/SPARK-6996 and squashes the following commits:

d56c3e0 [Punya Biswal] Fix imports
c7e308b [Punya Biswal] Support java iterable types in POJOs
5e00685 [Punya Biswal] Support map types in java beans
nemccarthy pushed a commit to nemccarthy/spark that referenced this pull request Jun 19, 2015
liancheng mengxr this is similar to apache#5146.

Author: Punya Biswal <pbiswal@palantir.com>

Closes apache#5578 from punya/feature/SPARK-6996 and squashes the following commits:

d56c3e0 [Punya Biswal] Fix imports
c7e308b [Punya Biswal] Support java iterable types in POJOs
5e00685 [Punya Biswal] Support map types in java beans
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants