carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jack...@apache.org
Subject carbondata git commit: [CARBONDATA-1810] Bad record path is not correct for UT
Date Mon, 27 Nov 2017 09:21:14 GMT
Repository: carbondata
Updated Branches:
  refs/heads/master f8e0585d2 -> 6d9cec91b


[CARBONDATA-1810] Bad record path is not correct for UT

Changed bad record path in TestQueryExecutor

This closes #1568


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

Branch: refs/heads/master
Commit: 6d9cec91b6938754edd13990f2bbdfb666468c86
Parents: f8e0585
Author: xubo245 <601450868@qq.com>
Authored: Sun Nov 26 16:40:02 2017 +0800
Committer: Jacky Li <jacky.likun@qq.com>
Committed: Mon Nov 27 17:20:47 2017 +0800

----------------------------------------------------------------------
 .../scala/org/apache/carbondata/examples/ExampleUtils.scala | 1 +
 .../scala/org/apache/spark/sql/test/TestQueryExecutor.scala | 9 +++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/6d9cec91/examples/spark2/src/main/scala/org/apache/carbondata/examples/ExampleUtils.scala
----------------------------------------------------------------------
diff --git a/examples/spark2/src/main/scala/org/apache/carbondata/examples/ExampleUtils.scala
b/examples/spark2/src/main/scala/org/apache/carbondata/examples/ExampleUtils.scala
index 7975859..c62a240 100644
--- a/examples/spark2/src/main/scala/org/apache/carbondata/examples/ExampleUtils.scala
+++ b/examples/spark2/src/main/scala/org/apache/carbondata/examples/ExampleUtils.scala
@@ -42,6 +42,7 @@ object ExampleUtils {
       .addProperty(CarbonCommonConstants.CARBON_TIMESTAMP_FORMAT, "yyyy/MM/dd HH:mm:ss")
       .addProperty(CarbonCommonConstants.CARBON_DATE_FORMAT, "yyyy/MM/dd")
       .addProperty(CarbonCommonConstants.ENABLE_UNSAFE_COLUMN_PAGE_LOADING, "true")
+      .addProperty(CarbonCommonConstants.CARBON_BADRECORDS_LOC, "")
 
     import org.apache.spark.sql.CarbonSession._
     val spark = SparkSession

http://git-wip-us.apache.org/repos/asf/carbondata/blob/6d9cec91/integration/spark-common/src/main/scala/org/apache/spark/sql/test/TestQueryExecutor.scala
----------------------------------------------------------------------
diff --git a/integration/spark-common/src/main/scala/org/apache/spark/sql/test/TestQueryExecutor.scala
b/integration/spark-common/src/main/scala/org/apache/spark/sql/test/TestQueryExecutor.scala
index 4a91b47..9bde483 100644
--- a/integration/spark-common/src/main/scala/org/apache/spark/sql/test/TestQueryExecutor.scala
+++ b/integration/spark-common/src/main/scala/org/apache/spark/sql/test/TestQueryExecutor.scala
@@ -52,6 +52,8 @@ object TestQueryExecutor {
   val integrationPath = s"$projectPath/integration"
   val metastoredb = s"$integrationPath/spark-common/target"
   val location = s"$integrationPath/spark-common/target/dbpath"
+  val badStoreLocation = s"$integrationPath/spark-common/target/bad_store"
+  createDirectory(badStoreLocation)
   val masterUrl = {
     val property = System.getProperty("spark.master.url")
     if (property == null) {
@@ -135,15 +137,18 @@ object TestQueryExecutor {
   val INSTANCE = lookupQueryExecutor.newInstance().asInstanceOf[TestQueryExecutorRegister]
   CarbonProperties.getInstance()
     .addProperty(CarbonCommonConstants.CARBON_BAD_RECORDS_ACTION, "FORCE")
-    .addProperty(CarbonCommonConstants.CARBON_BADRECORDS_LOC, "/tmp/carbon/badrecords")
+    .addProperty(CarbonCommonConstants.CARBON_BADRECORDS_LOC, badStoreLocation)
     .addProperty(CarbonCommonConstants.DICTIONARY_SERVER_PORT,
       (CarbonCommonConstants.DICTIONARY_SERVER_PORT_DEFAULT.toInt + Random.nextInt(100))
+ "")
     .addProperty(CarbonCommonConstants.CARBON_MAX_DRIVER_LRU_CACHE_SIZE, "1024")
-      .addProperty(CarbonCommonConstants.CARBON_MAX_EXECUTOR_LRU_CACHE_SIZE, "1024")
+    .addProperty(CarbonCommonConstants.CARBON_MAX_EXECUTOR_LRU_CACHE_SIZE, "1024")
 
   private def lookupQueryExecutor: Class[_] = {
     ServiceLoader.load(classOf[TestQueryExecutorRegister], Utils.getContextOrSparkClassLoader)
       .iterator().next().getClass
   }
 
+  private def createDirectory(badStoreLocation: String) = {
+    FileFactory.mkdirs(badStoreLocation, FileFactory.getFileType(badStoreLocation))
+  }
 }


Mime
View raw message