You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ne...@apache.org on 2019/02/23 00:35:00 UTC

[incubator-pinot] branch disable_realtime_agg_if_mv_dimension updated: Add check for multi value metric

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

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


The following commit(s) were added to refs/heads/disable_realtime_agg_if_mv_dimension by this push:
     new 033222a  Add check for multi value metric
033222a is described below

commit 033222a56dd111aadc1de6dc968712d5a1874c3e
Author: Neha Pawar <np...@linkedin.com>
AuthorDate: Fri Feb 22 16:34:50 2019 -0800

    Add check for multi value metric
---
 .../pinot/core/indexsegment/mutable/MutableSegmentImpl.java  | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

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 f535a06..1447d10 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
@@ -333,6 +333,8 @@ public class MutableSegmentImpl implements MutableSegment {
           (FixedByteSingleColumnSingleValueReaderWriter) _indexReaderWriterMap.get(column);
       Preconditions.checkState(_dictionaryMap.get(column) == null, "Updating metrics not supported with dictionary.");
       FieldSpec.DataType dataType = metricSpec.getDataType();
+
+      // TODO: this breaks for multi value metrics. https://github.com/apache/incubator-pinot/issues/3867
       switch (dataType) {
         case INT:
           indexReaderWriter.setInt(docId, (Integer) value + indexReaderWriter.getInt(docId));
@@ -706,6 +708,7 @@ public class MutableSegmentImpl implements MutableSegment {
     }
 
     // All metric columns should have no-dictionary index.
+    // All metric columns must be single value
     for (String metric : schema.getMetricNames()) {
       if (!noDictionaryColumns.contains(metric)) {
         _logger
@@ -713,10 +716,17 @@ public class MutableSegmentImpl implements MutableSegment {
         _aggregateMetrics = false;
         break;
       }
+      // https://github.com/apache/incubator-pinot/issues/3867
+      if (!schema.getMetricSpec(metric).isSingleValueField()) {
+        _logger
+            .warn("Metrics aggregation cannot be turned ON in presence of multi-value metric columns, eg: {}", metric);
+        _aggregateMetrics = false;
+        break;
+      }
     }
 
     // All dimension columns should be dictionary encoded.
-    // All dimensions must be single value
+    // All dimension columns must be single value
     for (String dimension : schema.getDimensionNames()) {
       if (noDictionaryColumns.contains(dimension)) {
         _logger


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