This is an automated email from the ASF dual-hosted git repository.

ajantha pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/carbondata.git


The following commit(s) were added to refs/heads/master by this push:
     new ca19958  [HOTFIX] Concurrent insert test case failure fix
ca19958 is described below

commit ca199582004ee6e992052906d0a49bb4c1e76ee1
Author: kunal642 <kunalkapoor...@gmail.com>
AuthorDate: Tue Feb 11 11:51:28 2020 +0530

    [HOTFIX] Concurrent insert test case failure fix
    
    Why is this PR needed?
    System.currentTimeMillis() is giving same results for 2 insert due to
    which 1 load is deleting the temp folder for another load.
    
    What changes were proposed in this PR?
    1. Change to System.nanoTime()
    2. if schema file is not present, look up the relation again to infer
    the schema
    
    Does this PR introduce any user interface change?
    No
    
    Is any new testcase added?
    No
    
    This closes #3610
---
 .../spark/sql/execution/command/management/CarbonLoadDataCommand.scala  | 2 +-
 .../src/main/scala/org/apache/spark/sql/hive/CarbonFileMetastore.scala  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonLoadDataCommand.scala
 
b/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonLoadDataCommand.scala
index 482a5e1..5125d3b 100644
--- 
a/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonLoadDataCommand.scala
+++ 
b/integration/spark2/src/main/scala/org/apache/spark/sql/execution/command/management/CarbonLoadDataCommand.scala
@@ -290,7 +290,7 @@ case class CarbonLoadDataCommand(
           FileFactory.mkdirs(metadataDirectoryPath)
         }
       } else {
-        carbonLoadModel.setSegmentId(System.currentTimeMillis().toString)
+        carbonLoadModel.setSegmentId(System.nanoTime().toString)
       }
       val partitionStatus = SegmentStatus.SUCCESS
       val columnar = sparkSession.conf.get("carbon.is.columnar.storage", 
"true").toBoolean
diff --git 
a/integration/spark2/src/main/scala/org/apache/spark/sql/hive/CarbonFileMetastore.scala
 
b/integration/spark2/src/main/scala/org/apache/spark/sql/hive/CarbonFileMetastore.scala
index d3d1bd1..f65c5bb 100644
--- 
a/integration/spark2/src/main/scala/org/apache/spark/sql/hive/CarbonFileMetastore.scala
+++ 
b/integration/spark2/src/main/scala/org/apache/spark/sql/hive/CarbonFileMetastore.scala
@@ -88,7 +88,7 @@ private object CarbonFileMetastore {
         localTimeStamp != newTime
       }
     } else {
-      false
+      true
     }
   }
 

Reply via email to