carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravipes...@apache.org
Subject [1/2] incubator-carbondata git commit: [CARBONDATA-597] Unable to fetch data with "select" query
Date Thu, 05 Jan 2017 14:17:43 GMT
Repository: incubator-carbondata
Updated Branches:
  refs/heads/master f463642bb -> a2a081dfc


[CARBONDATA-597] Unable to fetch data with "select" query


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

Branch: refs/heads/master
Commit: 75aa0835fdeed1430d1609f0bf7d6064138d5243
Parents: f463642
Author: mohammadshahidkhan <mohdshahidkhan1987@gmail.com>
Authored: Thu Jan 5 19:13:34 2017 +0530
Committer: mohammadshahidkhan <mohdshahidkhan1987@gmail.com>
Committed: Thu Jan 5 19:33:33 2017 +0530

----------------------------------------------------------------------
 .../datastore/AbstractBlockIndexStoreCache.java   |  4 +---
 .../apache/carbondata/core/util/CarbonUtil.java   | 18 +++++++-----------
 2 files changed, 8 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/75aa0835/core/src/main/java/org/apache/carbondata/core/carbon/datastore/AbstractBlockIndexStoreCache.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/carbon/datastore/AbstractBlockIndexStoreCache.java
b/core/src/main/java/org/apache/carbondata/core/carbon/datastore/AbstractBlockIndexStoreCache.java
index d676c02..4e80926 100644
--- a/core/src/main/java/org/apache/carbondata/core/carbon/datastore/AbstractBlockIndexStoreCache.java
+++ b/core/src/main/java/org/apache/carbondata/core/carbon/datastore/AbstractBlockIndexStoreCache.java
@@ -92,9 +92,7 @@ public abstract class AbstractBlockIndexStoreCache<K, V>
       throws IOException {
     // calculate the required size is
     TableBlockInfo blockInfo = tableBlockUniqueIdentifier.getTableBlockInfo();
-    long requiredMetaSize = CarbonUtil
-        .calculateMetaSize(blockInfo.getFilePath(), blockInfo.getBlockOffset(),
-            blockInfo.getBlockLength());
+    long requiredMetaSize = CarbonUtil.calculateMetaSize(blockInfo);
     if (requiredMetaSize > 0) {
       tableBlock.setMemorySize(requiredMetaSize);
       tableBlock.incrementAccessCount();

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/75aa0835/core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java b/core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java
index 27dae6d..dc28513 100644
--- a/core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java
+++ b/core/src/main/java/org/apache/carbondata/core/util/CarbonUtil.java
@@ -853,24 +853,20 @@ public final class CarbonUtil {
 
   /**
    * The method calculate the B-Tree metadata size.
-   * @param filePath
-   * @param blockOffset
-   * @param blockLength
+   * @param tableBlockInfo
    * @return
    */
-  public static long calculateMetaSize(String filePath, long blockOffset, long blockLength)
-      throws IOException {
+  public static long calculateMetaSize(TableBlockInfo tableBlockInfo) throws IOException
{
     FileHolder fileReader = null;
     try {
-      long completeBlockLength = blockOffset + blockLength;
+      long completeBlockLength = tableBlockInfo.getBlockLength();
       long footerPointer = completeBlockLength - 8;
+      String filePath = tableBlockInfo.getFilePath();
       fileReader = FileFactory.getFileHolder(FileFactory.getFileType(filePath));
       long actualFooterOffset = fileReader.readLong(filePath, footerPointer);
-      long size = footerPointer - actualFooterOffset;
-      return size;
-    }
-    finally {
-      if(null != fileReader) {
+      return footerPointer - actualFooterOffset;
+    } finally {
+      if (null != fileReader) {
         try {
           fileReader.finish();
         } catch (IOException e) {


Mime
View raw message