Skip to content

Commit 606f1e3

Browse files
committed
Missing drop
1 parent cc1bfcf commit 606f1e3

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

examples/src/main/java/org/apache/spark/examples/sql/JavaSQLDataSourceExample.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ private static void runBasicDataSourceExample(SparkSession spark) {
135135
// $example off:write_partition_and_bucket$
136136

137137
spark.sql("DROP TABLE IF EXISTS people_bucketed");
138+
spark.sql("DROP TABLE IF EXISTS people_partitioned_bucketed");
138139
}
139140

140141
private static void runBasicParquetExample(SparkSession spark) {

examples/src/main/python/sql/datasource.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ def basic_datasource_example(spark):
4848
.saveAsTable("people_partitioned_bucketed"))
4949
# $example off:write_partition_and_bucket$
5050

51-
spark.sql("DROP TABLE IF EXISTS people_partitioned_bucketed")
52-
5351
# $example on:manual_load_options$
5452
df = spark.read.load("examples/src/main/resources/people.json", format="json")
5553
df.select("name", "age").write.save("namesAndAges.parquet", format="parquet")
@@ -59,12 +57,12 @@ def basic_datasource_example(spark):
5957
df.write.bucketBy(42, "name").sortBy("age").saveAsTable("people_bucketed")
6058
# $example off:write_sorting_and_bucketing$
6159

62-
spark.sql("DROP TABLE IF EXISTS people_bucketed")
63-
6460
# $example on:direct_sql$
6561
df = spark.sql("SELECT * FROM parquet.`examples/src/main/resources/users.parquet`")
6662
# $example off:direct_sql$
6763

64+
spark.sql("DROP TABLE IF EXISTS people_bucketed")
65+
spark.sql("DROP TABLE IF EXISTS people_partitioned_bucketed")
6866

6967
def parquet_example(spark):
7068
# $example on:basic_parquet_example$

examples/src/main/scala/org/apache/spark/examples/sql/SQLDataSourceExample.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ object SQLDataSourceExample {
6767
// $example off:write_partition_and_bucket$
6868

6969
spark.sql("DROP TABLE IF EXISTS people_bucketed")
70+
spark.sql("DROP TABLE IF EXISTS people_partitioned_bucketed")
7071
}
7172

7273
private def runBasicParquetExample(spark: SparkSession): Unit = {

0 commit comments

Comments
 (0)