Skip to content

Conversation

@liancheng
Copy link
Contributor

What changes were proposed in this pull request?

This PR makes various minor updates to examples of all language bindings to make sure they are consistent with each other. Some typos and missing parts (JDBC example in Scala/Java/Python) are also fixed.

How was this patch tested?

Manually tested.

@liancheng
Copy link
Contributor Author

@SparkQA
Copy link

SparkQA commented Jul 26, 2016

Test build #62883 has finished for PR 14368 at commit e1a521f.

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

## +----+-------+
## | age| name|
## +----+-------+
## |null|Michael|
Copy link
Member

Choose a reason for hiding this comment

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

hmm.. this is correct? I think it says NA in R

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not familiar with SparkR, so please correct me if I'm wrong. IIRC, showDF is mapped to the Scala method Dataset.show(), which executes in the JVM, where NA isn't available, and we have to use null as the only reasonable alternative. You may see that the previous head(df) call does print NA instead of null.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, I simply executed the example R script and copied/pasted the output here from console.

Copy link
Member

@felixcheung felixcheung Jul 27, 2016

Choose a reason for hiding this comment

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

ah, I checked the code and saw why. head and take are collecting the DataFrame in which the JVM->R conversion takes place. As you said, showDF is calling a JVM method. I guess it's not super friendly to R users but null is used in some Spark DataFrame SQL functions.

ok for this doc update then.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review!

@yhuai
Copy link
Contributor

yhuai commented Aug 1, 2016

@liancheng after second thought, I think it makes sense to also merge it to branch 2.0 to avoid potential conflicts on doc fixes.


# $example on:init_session$
sparkR.session(appName = "MyApp", sparkConfig = list(spark.executor.memory = "1g"))
sparkR.session(appName = "MyApp", sparkConfig = list(spark.some.config.option = "some-value"))
Copy link
Contributor

Choose a reason for hiding this comment

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

where do we read this config?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's just an example for how to set extra configuration options. It's not read anywhere.

@cloud-fan
Copy link
Contributor

retest this please

@cloud-fan
Copy link
Contributor

LGTM

@SparkQA
Copy link

SparkQA commented Aug 2, 2016

Test build #63103 has finished for PR 14368 at commit e1a521f.

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

@asfgit asfgit closed this in 10e1c0e Aug 2, 2016
asfgit pushed a commit that referenced this pull request Aug 2, 2016
## What changes were proposed in this pull request?

This PR makes various minor updates to examples of all language bindings to make sure they are consistent with each other. Some typos and missing parts (JDBC example in Scala/Java/Python) are also fixed.

## How was this patch tested?

Manually tested.

Author: Cheng Lian <[email protected]>

Closes #14368 from liancheng/revise-examples.

(cherry picked from commit 10e1c0e)
Signed-off-by: Wenchen Fan <[email protected]>
@cloud-fan
Copy link
Contributor

thanks, merging to master and 2.0!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants