carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From manishgupt...@apache.org
Subject carbondata git commit: [CARBONDATA-1759] Make visibility of segments as false eventhough file is not present in clean file operation
Date Wed, 13 Dec 2017 04:31:20 GMT
Repository: carbondata
Updated Branches:
  refs/heads/master b6f29dec4 -> 970a32a26


[CARBONDATA-1759] Make visibility of segments as false eventhough file is not present in clean
file operation

Make visibility of segments as false eventhough file is not present to fix bug in show segments
after clean files operation.

This closes #1627


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

Branch: refs/heads/master
Commit: 970a32a2647b73fd40ba5eb7d953a35e50320a25
Parents: b6f29de
Author: akashrn5 <akashnilugal@gmail.com>
Authored: Wed Dec 6 10:40:53 2017 +0530
Committer: manishgupta88 <tomanishgupta18@gmail.com>
Committed: Wed Dec 13 10:04:08 2017 +0530

----------------------------------------------------------------------
 .../allqueries/InsertIntoCarbonTableTestCase.scala     | 13 +++++++++++++
 .../carbondata/processing/util/DeleteLoadFolders.java  |  4 +++-
 2 files changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/970a32a2/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/allqueries/InsertIntoCarbonTableTestCase.scala
----------------------------------------------------------------------
diff --git a/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/allqueries/InsertIntoCarbonTableTestCase.scala
b/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/allqueries/InsertIntoCarbonTableTestCase.scala
index 09f4451..137e1cb 100644
--- a/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/allqueries/InsertIntoCarbonTableTestCase.scala
+++ b/integration/spark-common-test/src/test/scala/org/apache/carbondata/spark/testsuite/allqueries/InsertIntoCarbonTableTestCase.scala
@@ -278,6 +278,18 @@ class InsertIntoCarbonTableTestCase extends QueryTest with BeforeAndAfterAll
{
     assert(rowCount == sql("select imei from TCarbonSourceOverwrite").count())
   }
 
+  test("test show segments after clean files for insert overwrite") {
+    sql("drop table if exists show_insert")
+    sql("create table show_insert (name String, age int) stored by 'carbondata'")
+    sql("insert into show_insert select 'abc',1")
+    sql("insert into show_insert select 'abc',1")
+    sql("insert into show_insert select 'abc',1")
+    sql("insert overwrite table show_insert select * from show_insert")
+    assert(sql("show segments for table show_insert").collect().length == 4)
+    sql("clean files for table show_insert")
+    assert(sql("show segments for table show_insert").collect().length == 1)
+  }
+
   override def afterAll {
     sql("drop table if exists load")
     sql("drop table if exists inser")
@@ -296,6 +308,7 @@ class InsertIntoCarbonTableTestCase extends QueryTest with BeforeAndAfterAll
{
     sql("drop table if exists carbon_table")
     sql("DROP TABLE IF EXISTS student")
     sql("DROP TABLE IF EXISTS uniqdata")
+    sql("DROP TABLE IF EXISTS show_insert")
 
     if (timeStampPropOrig != null) {
       CarbonProperties.getInstance()

http://git-wip-us.apache.org/repos/asf/carbondata/blob/970a32a2/processing/src/main/java/org/apache/carbondata/processing/util/DeleteLoadFolders.java
----------------------------------------------------------------------
diff --git a/processing/src/main/java/org/apache/carbondata/processing/util/DeleteLoadFolders.java
b/processing/src/main/java/org/apache/carbondata/processing/util/DeleteLoadFolders.java
index 09e7b47..a6bbe48 100644
--- a/processing/src/main/java/org/apache/carbondata/processing/util/DeleteLoadFolders.java
+++ b/processing/src/main/java/org/apache/carbondata/processing/util/DeleteLoadFolders.java
@@ -95,7 +95,9 @@ public final class DeleteLoadFolders {
         }
 
       } else {
-        status = false;
+        LOGGER.warn("Files are not found in segment " + path
+            + " it seems, files are already being deleted");
+        status = true;
       }
     } catch (IOException e) {
       LOGGER.warn("Unable to delete the file as per delete command " + path);


Mime
View raw message