Skip to content

Commit 1ce29fb

Browse files
committed
Fix more
1 parent 1f8c11e commit 1ce29fb

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

examples/src/main/java/org/apache/spark/examples/sql/hive/JavaSparkHiveExample.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package org.apache.spark.examples.sql.hive;
1818

1919
// $example on:spark_hive$
20+
import java.io.File;
2021
import java.io.Serializable;
2122
import java.util.ArrayList;
2223
import java.util.List;
@@ -56,7 +57,7 @@ public void setValue(String value) {
5657
public static void main(String[] args) {
5758
// $example on:spark_hive$
5859
// warehouseLocation points to the default location for managed databases and tables
59-
String warehouseLocation = "spark-warehouse";
60+
String warehouseLocation = new File("spark-warehouse").getAbsolutePath();
6061
SparkSession spark = SparkSession
6162
.builder()
6263
.appName("Java Spark Hive Example")

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from __future__ import print_function
1919

2020
# $example on:spark_hive$
21-
from os.path import expanduser, join
21+
from os.path import expanduser, join, abspath
2222

2323
from pyspark.sql import SparkSession
2424
from pyspark.sql import Row
@@ -34,7 +34,7 @@
3434
if __name__ == "__main__":
3535
# $example on:spark_hive$
3636
# warehouse_location points to the default location for managed databases and tables
37-
warehouse_location = 'spark-warehouse'
37+
warehouse_location = abspath('spark-warehouse')
3838

3939
spark = SparkSession \
4040
.builder \

examples/src/main/scala/org/apache/spark/examples/sql/hive/SparkHiveExample.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
package org.apache.spark.examples.sql.hive
1818

1919
// $example on:spark_hive$
20+
import java.io.File
21+
2022
import org.apache.spark.sql.Row
2123
import org.apache.spark.sql.SparkSession
2224
// $example off:spark_hive$
@@ -38,7 +40,7 @@ object SparkHiveExample {
3840

3941
// $example on:spark_hive$
4042
// warehouseLocation points to the default location for managed databases and tables
41-
val warehouseLocation = "spark-warehouse"
43+
val warehouseLocation = new File("spark-warehouse").getAbsolutePath
4244

4345
val spark = SparkSession
4446
.builder()

0 commit comments

Comments
 (0)