diff options
author | Cheng Lian <lian@databricks.com> | 2016-06-29 22:50:53 -0700 |
---|---|---|
committer | Xiangrui Meng <meng@databricks.com> | 2016-06-29 22:50:53 -0700 |
commit | bde1d6a61593aeb62370f526542cead94919b0c0 (patch) | |
tree | 8630ee0675f1be8b45b8f4d72a9ced10f6d2eb80 /examples/src/main/java | |
parent | d3af6731fa270842818ed91d6b4d14708ddae2db (diff) | |
download | spark-bde1d6a61593aeb62370f526542cead94919b0c0.tar.gz spark-bde1d6a61593aeb62370f526542cead94919b0c0.tar.bz2 spark-bde1d6a61593aeb62370f526542cead94919b0c0.zip |
[SPARK-16294][SQL] Labelling support for the include_example Jekyll plugin
## What changes were proposed in this pull request?
This PR adds labelling support for the `include_example` Jekyll plugin, so that we may split a single source file into multiple line blocks with different labels, and include them in multiple code snippets in the generated HTML page.
## How was this patch tested?
Manually tested.
<img width="923" alt="screenshot at jun 29 19-53-21" src="https://cloud.githubusercontent.com/assets/230655/16451099/66a76db2-3e33-11e6-84fb-63104c2f0688.png">
Author: Cheng Lian <lian@databricks.com>
Closes #13972 from liancheng/include-example-with-labels.
Diffstat (limited to 'examples/src/main/java')
-rw-r--r-- | examples/src/main/java/org/apache/spark/examples/sql/JavaSparkSQL.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/src/main/java/org/apache/spark/examples/sql/JavaSparkSQL.java b/examples/src/main/java/org/apache/spark/examples/sql/JavaSparkSQL.java index e512979ac7..7fc6c007b6 100644 --- a/examples/src/main/java/org/apache/spark/examples/sql/JavaSparkSQL.java +++ b/examples/src/main/java/org/apache/spark/examples/sql/JavaSparkSQL.java @@ -26,7 +26,9 @@ import org.apache.spark.api.java.function.Function; import org.apache.spark.sql.Dataset; import org.apache.spark.sql.Row; +// $example on:init_session$ import org.apache.spark.sql.SparkSession; +// $example off:init_session$ public class JavaSparkSQL { public static class Person implements Serializable { @@ -51,10 +53,13 @@ public class JavaSparkSQL { } public static void main(String[] args) throws Exception { + // $example on:init_session$ SparkSession spark = SparkSession .builder() .appName("JavaSparkSQL") + .config("spark.some.config.option", "some-value") .getOrCreate(); + // $example off:init_session$ System.out.println("=== Data source: RDD ==="); // Load a text file and convert each line to a Java Bean. |