Github user liancheng commented on a diff in the pull request:
https://github.com/apache/spark/pull/14368#discussion_r72387754
--- Diff: examples/src/main/r/RSparkSQLExample.R ---
@@ -18,31 +18,43 @@
library(SparkR)
# $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"))
# $example off:init_session$
-# $example on:create_DataFrames$
+# $example on:create_df$
df <- read.json("examples/src/main/resources/people.json")
# Displays the content of the DataFrame
head(df)
+## age name
+## 1 NA Michael
+## 2 30 Andy
+## 3 19 Justin
# Another method to print the first few rows and optionally truncate the
printing of long values
showDF(df)
-# $example off:create_DataFrames$
+## +----+-------+
+## | age| name|
+## +----+-------+
+## |null|Michael|
--- End diff --
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`.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]