carbondata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravipes...@apache.org
Subject [08/20] incubator-carbondata git commit: [CARBONDATA-136] Fixed Query data mismatch issue after compaction (#903)
Date Sat, 06 Aug 2016 10:00:25 GMT
[CARBONDATA-136] Fixed Query data mismatch issue after compaction (#903)



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

Branch: refs/heads/master
Commit: b327375a39f485574782441b425754aa64904d0d
Parents: 627590e
Author: Kumar Vishal <kumarvishal.1802@gmail.com>
Authored: Thu Aug 4 12:30:50 2016 +0530
Committer: Venkata Ramana G <g.ramana.v1@gmail.com>
Committed: Thu Aug 4 12:30:50 2016 +0530

----------------------------------------------------------------------
 .../impl/InternalDetailQueryExecutor.java       | 20 ++++++++------------
 .../AbstractDetailQueryResultIterator.java      | 14 +++++++++++---
 2 files changed, 19 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/b327375a/core/src/main/java/org/carbondata/query/carbon/executor/internal/impl/InternalDetailQueryExecutor.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/query/carbon/executor/internal/impl/InternalDetailQueryExecutor.java
b/core/src/main/java/org/carbondata/query/carbon/executor/internal/impl/InternalDetailQueryExecutor.java
index 04cc659..0152a9c 100644
--- a/core/src/main/java/org/carbondata/query/carbon/executor/internal/impl/InternalDetailQueryExecutor.java
+++ b/core/src/main/java/org/carbondata/query/carbon/executor/internal/impl/InternalDetailQueryExecutor.java
@@ -64,19 +64,16 @@ public class InternalDetailQueryExecutor implements InternalQueryExecutor
{
 
     // in case of compaction we will pass the in memory record size.
     int inMemoryRecordSizeInModel = queryModel.getInMemoryRecordSize();
-    if(inMemoryRecordSizeInModel > 0){
+    if (inMemoryRecordSizeInModel > 0) {
       recordSize = inMemoryRecordSizeInModel;
-    }
-    else {
+    } else {
       String defaultInMemoryRecordsSize =
           CarbonProperties.getInstance().getProperty(CarbonCommonConstants.INMEMORY_REOCRD_SIZE);
-      if (null != defaultInMemoryRecordsSize) {
-        try {
-          recordSize = Integer.parseInt(defaultInMemoryRecordsSize);
-        } catch (NumberFormatException ne) {
-          LOGGER.error("Invalid inmemory records size. Using default value");
-          recordSize = CarbonCommonConstants.INMEMORY_REOCRD_SIZE_DEFAULT;
-        }
+      try {
+        recordSize = Integer.parseInt(defaultInMemoryRecordsSize);
+      } catch (NumberFormatException ne) {
+        LOGGER.error("Invalid inmemory records size. Using default value");
+        recordSize = CarbonCommonConstants.INMEMORY_REOCRD_SIZE_DEFAULT;
       }
     }
     LOGGER.info("In memory record size considered is: " + recordSize);
@@ -97,8 +94,7 @@ public class InternalDetailQueryExecutor implements InternalQueryExecutor
{
    * @param sliceIndexes   slice indexes to be executed
    * @return query result
    */
-  @Override public CarbonIterator<Result> executeQuery(
-      List<BlockExecutionInfo> executionInfos,
+  @Override public CarbonIterator<Result> executeQuery(List<BlockExecutionInfo>
executionInfos,
       int[] sliceIndexes) throws QueryExecutionException {
     long startTime = System.currentTimeMillis();
     QueryRunner task;

http://git-wip-us.apache.org/repos/asf/incubator-carbondata/blob/b327375a/core/src/main/java/org/carbondata/query/carbon/result/iterator/AbstractDetailQueryResultIterator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/carbondata/query/carbon/result/iterator/AbstractDetailQueryResultIterator.java
b/core/src/main/java/org/carbondata/query/carbon/result/iterator/AbstractDetailQueryResultIterator.java
index dc94704..e5ef45c 100644
--- a/core/src/main/java/org/carbondata/query/carbon/result/iterator/AbstractDetailQueryResultIterator.java
+++ b/core/src/main/java/org/carbondata/query/carbon/result/iterator/AbstractDetailQueryResultIterator.java
@@ -97,10 +97,18 @@ public abstract class AbstractDetailQueryResultIterator extends CarbonIterator
{
   public AbstractDetailQueryResultIterator(List<BlockExecutionInfo> infos,
       QueryExecutorProperties executerProperties, QueryModel queryModel,
       InternalQueryExecutor queryExecutor) {
+    // below code will be used to update the number of cores based on number
+    // records we
+    // can keep in memory while executing the query execution
     int recordSize = 0;
-    String defaultInMemoryRecordsSize =
-        CarbonProperties.getInstance().getProperty(CarbonCommonConstants.INMEMORY_REOCRD_SIZE);
-    if (null != defaultInMemoryRecordsSize) {
+
+    // in case of compaction we will pass the in memory record size.
+    int inMemoryRecordSizeInModel = queryModel.getInMemoryRecordSize();
+    if (inMemoryRecordSizeInModel > 0) {
+      recordSize = inMemoryRecordSizeInModel;
+    } else {
+      String defaultInMemoryRecordsSize =
+          CarbonProperties.getInstance().getProperty(CarbonCommonConstants.INMEMORY_REOCRD_SIZE);
       try {
         recordSize = Integer.parseInt(defaultInMemoryRecordsSize);
       } catch (NumberFormatException ne) {


Mime
View raw message