Repository: spark
Updated Branches:
  refs/heads/branch-2.2 1cf3e3a26 -> 7a97943f2


[SPARK-20694][EXAMPLES] Update SQLDataSourceExample.scala

## What changes were proposed in this pull request?

Create table using the right DataFrame. peopleDF->usersDF

peopleDF:
+----+-------+
| age|   name|
+----+-------+
usersDF:
+------+--------------+----------------+
|  name|favorite_color|favorite_numbers|
+------+--------------+----------------+

## How was this patch tested?

Manually tested.

Author: CNRui <[email protected]>

Closes #20052 from CNRui/patch-2.

(cherry picked from commit ea2642eb0ebcf02e8fba727a82c140c9f2284725)
Signed-off-by: Sean Owen <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/7a97943f
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/7a97943f
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/7a97943f

Branch: refs/heads/branch-2.2
Commit: 7a97943f275e07b90258f70e4e4fd063ccfbe796
Parents: 1cf3e3a
Author: CNRui <[email protected]>
Authored: Sat Dec 23 08:18:08 2017 -0600
Committer: Sean Owen <[email protected]>
Committed: Sat Dec 23 08:18:16 2017 -0600

----------------------------------------------------------------------
 .../org/apache/spark/examples/sql/SQLDataSourceExample.scala   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/7a97943f/examples/src/main/scala/org/apache/spark/examples/sql/SQLDataSourceExample.scala
----------------------------------------------------------------------
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 6ff03bd..2613162 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
@@ -59,15 +59,15 @@ object SQLDataSourceExample {
     
usersDF.write.partitionBy("favorite_color").format("parquet").save("namesPartByColor.parquet")
     // $example off:write_partitioning$
     // $example on:write_partition_and_bucket$
-    peopleDF
+    usersDF
       .write
       .partitionBy("favorite_color")
       .bucketBy(42, "name")
-      .saveAsTable("people_partitioned_bucketed")
+      .saveAsTable("users_partitioned_bucketed")
     // $example off:write_partition_and_bucket$
 
     spark.sql("DROP TABLE IF EXISTS people_bucketed")
-    spark.sql("DROP TABLE IF EXISTS people_partitioned_bucketed")
+    spark.sql("DROP TABLE IF EXISTS users_partitioned_bucketed")
   }
 
   private def runBasicParquetExample(spark: SparkSession): Unit = {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to