File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
java/org/apache/spark/examples/sql/hive
scala/org/apache/spark/examples/sql/hive Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 1717package org .apache .spark .examples .sql .hive ;
1818
1919// $example on:spark_hive$
20+ import java .io .File ;
2021import java .io .Serializable ;
2122import java .util .ArrayList ;
2223import 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" )
Original file line number Diff line number Diff line change 1818from __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
2323from pyspark .sql import SparkSession
2424from pyspark .sql import Row
3434if __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 \
Original file line number Diff line number Diff line change 1717package org .apache .spark .examples .sql .hive
1818
1919// $example on:spark_hive$
20+ import java .io .File
21+
2022import org .apache .spark .sql .Row
2123import 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()
You can’t perform that action at this time.
0 commit comments