You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@carbondata.apache.org by ja...@apache.org on 2018/11/17 11:55:03 UTC

carbondata git commit: [HOTFIX]s3 lock file fix

Repository: carbondata
Updated Branches:
  refs/heads/master 39e8e3da5 -> d4e8ba441


[HOTFIX]s3 lock file fix

This closes #2922


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

Branch: refs/heads/master
Commit: d4e8ba441100bc477c62d04e3b0c63aa8b574ad1
Parents: 39e8e3d
Author: akashrn5 <ak...@gmail.com>
Authored: Wed Nov 14 21:53:39 2018 +0530
Committer: Jacky Li <ja...@qq.com>
Committed: Sat Nov 17 15:54:37 2018 +0400

----------------------------------------------------------------------
 .../carbondata/core/datastore/filesystem/S3CarbonFile.java      | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/carbondata/blob/d4e8ba44/core/src/main/java/org/apache/carbondata/core/datastore/filesystem/S3CarbonFile.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/datastore/filesystem/S3CarbonFile.java b/core/src/main/java/org/apache/carbondata/core/datastore/filesystem/S3CarbonFile.java
index f1f9fd2..ee67097 100644
--- a/core/src/main/java/org/apache/carbondata/core/datastore/filesystem/S3CarbonFile.java
+++ b/core/src/main/java/org/apache/carbondata/core/datastore/filesystem/S3CarbonFile.java
@@ -107,8 +107,11 @@ public class S3CarbonFile extends HDFSCarbonFile {
         // create buffer
         byte[] byteStreamBuffer = new byte[count];
         int bytesRead = dataInputStream.read(byteStreamBuffer);
+        dataInputStream.close();
         stream = fileSystem.create(pt, true, bufferSize);
-        stream.write(byteStreamBuffer, 0, bytesRead);
+        if (bytesRead > 0) {
+          stream.write(byteStreamBuffer, 0, bytesRead);
+        }
       } else {
         stream = fileSystem.create(pt, true, bufferSize);
       }