Repository: phoenix
Updated Branches:
  refs/heads/master 8f01b5fad -> f5512105c


PHOENIX-4056 Spark 2.2 empty path fix (Stepan Migunov)


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

Branch: refs/heads/master
Commit: f5512105c6507d948b7bca789ece29dee5917711
Parents: 8f01b5f
Author: Josh Mahonin <jmaho...@gmail.com>
Authored: Fri Feb 9 15:03:25 2018 -0500
Committer: Josh Mahonin <jmaho...@gmail.com>
Committed: Fri Feb 9 15:03:25 2018 -0500

----------------------------------------------------------------------
 .../scala/org/apache/phoenix/spark/DataFrameFunctions.scala    | 6 +++++-
 .../scala/org/apache/phoenix/spark/ProductRDDFunctions.scala   | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/f5512105/phoenix-spark/src/main/scala/org/apache/phoenix/spark/DataFrameFunctions.scala
----------------------------------------------------------------------
diff --git 
a/phoenix-spark/src/main/scala/org/apache/phoenix/spark/DataFrameFunctions.scala
 
b/phoenix-spark/src/main/scala/org/apache/phoenix/spark/DataFrameFunctions.scala
index 92f4c58..be4a32b 100644
--- 
a/phoenix-spark/src/main/scala/org/apache/phoenix/spark/DataFrameFunctions.scala
+++ 
b/phoenix-spark/src/main/scala/org/apache/phoenix/spark/DataFrameFunctions.scala
@@ -57,7 +57,11 @@ class DataFrameFunctions(data: DataFrame) extends 
Serializable {
 
     // Save it
     phxRDD.saveAsNewAPIHadoopFile(
-      "",
+      Option(
+        conf.get("mapreduce.output.fileoutputformat.outputdir")
+      ).getOrElse(
+        Option(conf.get("mapred.output.dir")).getOrElse("")
+      ),
       classOf[NullWritable],
       classOf[PhoenixRecordWritable],
       classOf[PhoenixOutputFormat[PhoenixRecordWritable]],

http://git-wip-us.apache.org/repos/asf/phoenix/blob/f5512105/phoenix-spark/src/main/scala/org/apache/phoenix/spark/ProductRDDFunctions.scala
----------------------------------------------------------------------
diff --git 
a/phoenix-spark/src/main/scala/org/apache/phoenix/spark/ProductRDDFunctions.scala
 
b/phoenix-spark/src/main/scala/org/apache/phoenix/spark/ProductRDDFunctions.scala
index 9b368b6..1b33e6e 100644
--- 
a/phoenix-spark/src/main/scala/org/apache/phoenix/spark/ProductRDDFunctions.scala
+++ 
b/phoenix-spark/src/main/scala/org/apache/phoenix/spark/ProductRDDFunctions.scala
@@ -49,7 +49,11 @@ class ProductRDDFunctions[A <: Product](data: RDD[A]) 
extends Serializable {
 
     // Save it
     phxRDD.saveAsNewAPIHadoopFile(
-      "",
+      Option(
+        conf.get("mapreduce.output.fileoutputformat.outputdir")
+      ).getOrElse(
+        Option(conf.get("mapred.output.dir")).getOrElse("")
+      ),
       classOf[NullWritable],
       classOf[PhoenixRecordWritable],
       classOf[PhoenixOutputFormat[PhoenixRecordWritable]],

Reply via email to