diff options
author | Cheng Lian <lian@databricks.com> | 2016-07-18 23:07:59 -0700 |
---|---|---|
committer | Yin Huai <yhuai@databricks.com> | 2016-07-18 23:07:59 -0700 |
commit | 1426a080528bdb470b5e81300d892af45dd188bf (patch) | |
tree | abf255120eb8c225179436b5614ab37a3b3283ab /examples/src | |
parent | e5fbb182c04be8524045fc90541497f506b42f4a (diff) | |
download | spark-1426a080528bdb470b5e81300d892af45dd188bf.tar.gz spark-1426a080528bdb470b5e81300d892af45dd188bf.tar.bz2 spark-1426a080528bdb470b5e81300d892af45dd188bf.zip |
[SPARK-16303][DOCS][EXAMPLES] Minor Scala/Java example update
## What changes were proposed in this pull request?
This PR moves one and the last hard-coded Scala example snippet from the SQL programming guide into `SparkSqlExample.scala`. It also renames all Scala/Java example files so that all "Sql" in the file names are updated to "SQL".
## How was this patch tested?
Manually verified the generated HTML page.
Author: Cheng Lian <lian@databricks.com>
Closes #14245 from liancheng/minor-scala-example-update.
Diffstat (limited to 'examples/src')
-rw-r--r-- | examples/src/main/java/org/apache/spark/examples/sql/JavaSQLDataSourceExample.java (renamed from examples/src/main/java/org/apache/spark/examples/sql/JavaSqlDataSourceExample.java) | 2 | ||||
-rw-r--r-- | examples/src/main/java/org/apache/spark/examples/sql/JavaSparkSQLExample.java (renamed from examples/src/main/java/org/apache/spark/examples/sql/JavaSparkSqlExample.java) | 2 | ||||
-rw-r--r-- | examples/src/main/scala/org/apache/spark/examples/sql/SQLDataSourceExample.scala (renamed from examples/src/main/scala/org/apache/spark/examples/sql/SqlDataSourceExample.scala) | 2 | ||||
-rw-r--r-- | examples/src/main/scala/org/apache/spark/examples/sql/SparkSQLExample.scala (renamed from examples/src/main/scala/org/apache/spark/examples/sql/SparkSqlExample.scala) | 8 |
4 files changed, 7 insertions, 7 deletions
diff --git a/examples/src/main/java/org/apache/spark/examples/sql/JavaSqlDataSourceExample.java b/examples/src/main/java/org/apache/spark/examples/sql/JavaSQLDataSourceExample.java index 4db5e1b0af..2b94b9f114 100644 --- a/examples/src/main/java/org/apache/spark/examples/sql/JavaSqlDataSourceExample.java +++ b/examples/src/main/java/org/apache/spark/examples/sql/JavaSQLDataSourceExample.java @@ -35,7 +35,7 @@ import org.apache.spark.sql.Row; // $example off:basic_parquet_example$ import org.apache.spark.sql.SparkSession; -public class JavaSqlDataSourceExample { +public class JavaSQLDataSourceExample { // $example on:schema_merging$ public static class Square implements Serializable { diff --git a/examples/src/main/java/org/apache/spark/examples/sql/JavaSparkSqlExample.java b/examples/src/main/java/org/apache/spark/examples/sql/JavaSparkSQLExample.java index 586d6e3a3e..afc18078d4 100644 --- a/examples/src/main/java/org/apache/spark/examples/sql/JavaSparkSqlExample.java +++ b/examples/src/main/java/org/apache/spark/examples/sql/JavaSparkSQLExample.java @@ -60,7 +60,7 @@ import org.apache.spark.sql.types.StructType; import static org.apache.spark.sql.functions.col; // $example off:untyped_ops$ -public class JavaSparkSqlExample { +public class JavaSparkSQLExample { // $example on:create_ds$ public static class Person implements Serializable { private String name; diff --git a/examples/src/main/scala/org/apache/spark/examples/sql/SqlDataSourceExample.scala b/examples/src/main/scala/org/apache/spark/examples/sql/SQLDataSourceExample.scala index 61dea6ad2c..0caba12af0 100644 --- a/examples/src/main/scala/org/apache/spark/examples/sql/SqlDataSourceExample.scala +++ b/examples/src/main/scala/org/apache/spark/examples/sql/SQLDataSourceExample.scala @@ -18,7 +18,7 @@ package org.apache.spark.examples.sql import org.apache.spark.sql.SparkSession -object SqlDataSourceExample { +object SQLDataSourceExample { case class Person(name: String, age: Long) diff --git a/examples/src/main/scala/org/apache/spark/examples/sql/SparkSqlExample.scala b/examples/src/main/scala/org/apache/spark/examples/sql/SparkSQLExample.scala index cf3f864267..952c074d03 100644 --- a/examples/src/main/scala/org/apache/spark/examples/sql/SparkSqlExample.scala +++ b/examples/src/main/scala/org/apache/spark/examples/sql/SparkSQLExample.scala @@ -25,12 +25,12 @@ import org.apache.spark.sql.Row import org.apache.spark.sql.SparkSession // $example off:init_session$ // $example on:programmatic_schema$ -import org.apache.spark.sql.types.StringType -import org.apache.spark.sql.types.StructField -import org.apache.spark.sql.types.StructType +// $example on:data_types$ +import org.apache.spark.sql.types._ +// $example off:data_types$ // $example off:programmatic_schema$ -object SparkSqlExample { +object SparkSQLExample { // $example on:create_ds$ // Note: Case classes in Scala 2.10 can support only up to 22 fields. To work around this limit, |