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

siddteotia pushed a commit to branch hotfix-0530
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git


The following commit(s) were added to refs/heads/hotfix-0530 by this push:
     new f7e1e5c  Initialize _aggregateMetric in constructor
f7e1e5c is described below

commit f7e1e5cc09232c1d1d5937662800f12d10fc2298
Author: Siddharth Teotia <steo...@steotia-mn1.linkedin.biz>
AuthorDate: Sun May 31 12:31:27 2020 -0700

    Initialize _aggregateMetric in constructor
---
 .../apache/pinot/core/indexsegment/mutable/MutableSegmentImpl.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git 
a/pinot-core/src/main/java/org/apache/pinot/core/indexsegment/mutable/MutableSegmentImpl.java
 
b/pinot-core/src/main/java/org/apache/pinot/core/indexsegment/mutable/MutableSegmentImpl.java
index 527572f..76b8c0d 100644
--- 
a/pinot-core/src/main/java/org/apache/pinot/core/indexsegment/mutable/MutableSegmentImpl.java
+++ 
b/pinot-core/src/main/java/org/apache/pinot/core/indexsegment/mutable/MutableSegmentImpl.java
@@ -208,6 +208,8 @@ public class MutableSegmentImpl implements MutableSegment {
 
     int avgNumMultiValues = config.getAvgNumMultiValues();
 
+    _aggregateMetrics = config.aggregateMetrics();
+
     // Initialize for each column
     for (FieldSpec fieldSpec : _physicalFieldSpecs) {
       String column = fieldSpec.getName();
@@ -342,9 +344,9 @@ public class MutableSegmentImpl implements MutableSegment {
       // of noDict on STRING/BYTES. Without metrics aggregation, memory 
pressure increases.
       // So to continue aggregating metrics for such cases, we will create 
dictionary even
       // if the column is part of noDictionary set from table config
-      if (fieldSpec instanceof DimensionFieldSpec && config.aggregateMetrics() 
&& (dataType == FieldSpec.DataType.STRING ||
+      if (fieldSpec instanceof DimensionFieldSpec && _aggregateMetrics && 
(dataType == FieldSpec.DataType.STRING ||
           dataType == FieldSpec.DataType.BYTES)) {
-        _logger.info("Not creating dictionary in consuming segment for column 
{} of type {}", column, dataType.toString());
+        _logger.info("Will create dictionary in consuming segment for column 
{} of type {}", column, dataType.toString());
         return false;
       }
       // So don't create dictionary if the column is member of noDictionary, 
is single-value
@@ -857,7 +859,6 @@ public class MutableSegmentImpl implements MutableSegment {
    */
   private IdMap<FixedIntArray> 
enableMetricsAggregationIfPossible(RealtimeSegmentConfig config,
       Set<String> noDictionaryColumns) {
-    _aggregateMetrics = config.aggregateMetrics();
     if (!_aggregateMetrics) {
       _logger.info("Metrics aggregation is disabled.");
       return null;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to