carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jack...@apache.org
Subject [1/2] incubator-carbondata git commit: Fixing dataframe save when loading in cluster mode.
Date Mon, 14 Nov 2016 01:40:18 GMT
Repository: incubator-carbondata
Updated Branches:
  refs/heads/master 9302ff16d -> fc28fef2c


Fixing dataframe save when loading in cluster mode.

Fixed review comment

Fixed review comment


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

Branch: refs/heads/master
Commit: d7fa62e1faed4bb92f028cce0689d57f0de00348
Parents: 9302ff1
Author: ravipesala <ravi.pesala@gmail.com>
Authored: Thu Nov 10 20:33:32 2016 +0530
Committer: jackylk <jacky.likun@huawei.com>
Committed: Mon Nov 14 09:39:05 2016 +0800

----------------------------------------------------------------------
 .../org/apache/carbondata/spark/CarbonDataFrameWriter.scala  | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/d7fa62e1/integration/spark/src/main/scala/org/apache/carbondata/spark/CarbonDataFrameWriter.scala
----------------------------------------------------------------------
diff --git a/integration/spark/src/main/scala/org/apache/carbondata/spark/CarbonDataFrameWriter.scala
b/integration/spark/src/main/scala/org/apache/carbondata/spark/CarbonDataFrameWriter.scala
index 65ff787..2c5fb16 100644
--- a/integration/spark/src/main/scala/org/apache/carbondata/spark/CarbonDataFrameWriter.scala
+++ b/integration/spark/src/main/scala/org/apache/carbondata/spark/CarbonDataFrameWriter.scala
@@ -24,6 +24,7 @@ import org.apache.spark.sql.execution.command.LoadTable
 import org.apache.spark.sql.types._
 
 import org.apache.carbondata.core.carbon.metadata.datatype.{DataType => CarbonType}
+import org.apache.carbondata.core.constants.CarbonCommonConstants
 
 class CarbonDataFrameWriter(val dataFrame: DataFrame) extends Logging {
 
@@ -60,7 +61,12 @@ class CarbonDataFrameWriter(val dataFrame: DataFrame) extends Logging {
    */
   private def loadTempCSV(options: CarbonOption, cc: CarbonContext): Unit = {
     // temporary solution: write to csv file, then load the csv into carbon
-    val tempCSVFolder = "./tempCSV"
+    val storePath = CarbonEnv.getInstance(cc).carbonCatalog.storePath
+    val tempCSVFolder = new StringBuilder(storePath).append(CarbonCommonConstants.FILE_SEPARATOR)
+      .append("tempCSV")
+      .append(CarbonCommonConstants.UNDERSCORE).append(options.dbName)
+      .append(CarbonCommonConstants.UNDERSCORE).append(options.tableName)
+      .append(CarbonCommonConstants.UNDERSCORE).append(System.nanoTime()).toString
     writeToTempCSVFile(tempCSVFolder, options)
 
     val tempCSVPath = new Path(tempCSVFolder)


Mime
View raw message