You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by sa...@apache.org on 2023/05/15 10:13:09 UTC

[pinot] branch master updated: Improvements on the utility to convert table config to updated format (#10757)

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

saurabhd336 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new ca37a1e909 Improvements on the utility to convert table config to updated format (#10757)
ca37a1e909 is described below

commit ca37a1e90982b2495632720645ff6a5414508afb
Author: Shounak kulkarni <sh...@gmail.com>
AuthorDate: Mon May 15 15:43:00 2023 +0530

    Improvements on the utility to convert table config to updated format (#10757)
    
    * skip adding null index config to new format
    
    * add equals() and hashCode() overrides to index config classes
    
    * skip adding default index configs to fieldConfigList
    
    * ensure encodingType is set to DICTIONARY for new field config entry
    
    * handle the assignment of encodingType to field configs
    
    * use JsonUtils. Throw the exception.
    
    * check onHeap and useVarLengthDictionary flags after conversion
    
    * payload fix. Provide the compressionCodec value
    
    * remove unnecessary check. Check nullHandlingEnabled flag after conversion
    
    * null value handling
    
    * null value handling
---
 .../index/dictionary/DictionaryIndexType.java      | 54 ++++++++++++++++++++++
 .../index/nullvalue/NullValueIndexType.java        |  4 ++
 .../local/segment/index/NullValueIndexTest.java    | 14 +-----
 .../index/dictionary/DictionaryIndexTypeTest.java  | 51 +++++++++++++++-----
 .../index/forward/ForwardIndexTypeTest.java        |  3 +-
 .../pinot/segment/spi/index/AbstractIndexType.java |  9 +++-
 .../pinot/segment/spi/index/RangeIndexConfig.java  | 21 +++++++++
 .../pinot/segment/spi/index/TextIndexConfig.java   | 25 ++++++++++
 .../segment/spi/index/creator/H3IndexConfig.java   | 21 +++++++++
 .../spi/index/reader/H3IndexResolution.java        | 18 ++++++++
 .../apache/pinot/spi/config/table/IndexConfig.java | 18 ++++++++
 .../pinot/spi/config/table/JsonIndexConfig.java    | 25 ++++++++++
 12 files changed, 237 insertions(+), 26 deletions(-)

diff --git a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/dictionary/DictionaryIndexType.java b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/dictionary/DictionaryIndexType.java
index 3d1f726bb5..b6529992e7 100644
--- a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/dictionary/DictionaryIndexType.java
+++ b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/dictionary/DictionaryIndexType.java
@@ -19,12 +19,16 @@
 
 package org.apache.pinot.segment.local.segment.index.dictionary;
 
+import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
 import java.io.File;
 import java.io.IOException;
+import java.io.UncheckedIOException;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.function.Function;
@@ -70,6 +74,7 @@ import org.apache.pinot.spi.config.table.IndexingConfig;
 import org.apache.pinot.spi.config.table.TableConfig;
 import org.apache.pinot.spi.data.FieldSpec;
 import org.apache.pinot.spi.data.Schema;
+import org.apache.pinot.spi.utils.JsonUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -348,6 +353,55 @@ public class DictionaryIndexType
   @Override
   protected void handleIndexSpecificCleanup(TableConfig tableConfig) {
     IndexingConfig indexingConfig = tableConfig.getIndexingConfig();
+    List<String> noDictionaryColumns = indexingConfig.getNoDictionaryColumns() == null
+        ? Lists.newArrayList()
+        : indexingConfig.getNoDictionaryColumns();
+    List<FieldConfig> fieldConfigList = tableConfig.getFieldConfigList() == null
+        ? Lists.newArrayList()
+        : tableConfig.getFieldConfigList();
+
+    List<FieldConfig> configsToUpdate = new ArrayList<>();
+    for (FieldConfig fieldConfig : fieldConfigList) {
+      // skip further computation of field configs which already has RAW encodingType
+      if (fieldConfig.getEncodingType() == FieldConfig.EncodingType.RAW) {
+        continue;
+      }
+      // ensure encodingType is RAW on noDictionaryColumns
+      if (noDictionaryColumns.remove(fieldConfig.getName())) {
+        configsToUpdate.add(fieldConfig);
+      }
+      if (fieldConfig.getIndexes() == null || fieldConfig.getIndexes().get(getPrettyName()) == null) {
+        continue;
+      }
+      try {
+        DictionaryIndexConfig indexConfig = JsonUtils.jsonNodeToObject(
+            fieldConfig.getIndexes().get(getPrettyName()),
+            DictionaryIndexConfig.class);
+        // ensure encodingType is RAW where dictionary index config has disabled = true
+        if (indexConfig.isDisabled()) {
+          configsToUpdate.add(fieldConfig);
+        }
+      } catch (IOException e) {
+        throw new UncheckedIOException(e);
+      }
+    }
+
+    // update the encodingType to RAW on the selected field configs
+    for (FieldConfig fieldConfig : configsToUpdate) {
+      FieldConfig.Builder builder = new FieldConfig.Builder(fieldConfig);
+      builder.withEncodingType(FieldConfig.EncodingType.RAW);
+      fieldConfigList.remove(fieldConfig);
+      fieldConfigList.add(builder.build());
+    }
+
+    // create the missing field config for the remaining noDictionaryColumns
+    for (String column : noDictionaryColumns) {
+      FieldConfig.Builder builder = new FieldConfig.Builder(column);
+      builder.withEncodingType(FieldConfig.EncodingType.RAW);
+      fieldConfigList.add(builder.build());
+    }
+
+    // old configs cleanup
     indexingConfig.setNoDictionaryConfig(null);
     indexingConfig.setNoDictionaryColumns(null);
     indexingConfig.setOnHeapDictionaryColumns(null);
diff --git a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/nullvalue/NullValueIndexType.java b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/nullvalue/NullValueIndexType.java
index 0eb60a2935..fdde62cf7a 100644
--- a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/nullvalue/NullValueIndexType.java
+++ b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/nullvalue/NullValueIndexType.java
@@ -125,4 +125,8 @@ public class NullValueIndexType extends AbstractIndexType<IndexConfig, NullValue
       return new NullValueVectorReaderImpl(buffer);
     }
   }
+
+  @Override
+  public void convertToNewFormat(TableConfig tableConfig, Schema schema) {
+  }
 }
diff --git a/pinot-segment-local/src/test/java/org/apache/pinot/segment/local/segment/index/NullValueIndexTest.java b/pinot-segment-local/src/test/java/org/apache/pinot/segment/local/segment/index/NullValueIndexTest.java
index a4be3ee2fd..14a81421f5 100644
--- a/pinot-segment-local/src/test/java/org/apache/pinot/segment/local/segment/index/NullValueIndexTest.java
+++ b/pinot-segment-local/src/test/java/org/apache/pinot/segment/local/segment/index/NullValueIndexTest.java
@@ -18,15 +18,12 @@
  */
 package org.apache.pinot.segment.local.segment.index;
 
-import com.fasterxml.jackson.databind.JsonNode;
 import org.apache.pinot.segment.local.segment.index.nullvalue.NullValueIndexPlugin;
-import org.apache.pinot.segment.local.segment.index.nullvalue.NullValueIndexType;
 import org.apache.pinot.segment.spi.index.StandardIndexes;
 import org.testng.annotations.Test;
 
 import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertFalse;
-import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertTrue;
 
 
 public class NullValueIndexTest {
@@ -36,14 +33,7 @@ public class NullValueIndexTest {
     public void oldToNewConfConversion() {
       _tableConfig.getIndexingConfig().setNullHandlingEnabled(true);
       convertToUpdatedFormat();
-      assertNotNull(_tableConfig.getFieldConfigList());
-      assertFalse(_tableConfig.getFieldConfigList().isEmpty());
-      _tableConfig.getFieldConfigList()
-          .forEach(fieldConfig -> {
-            JsonNode indexConfig = fieldConfig.getIndexes().get(NullValueIndexType.INDEX_DISPLAY_NAME);
-            assertNotNull(indexConfig);
-            assertFalse(indexConfig.get("disabled").asBoolean());
-          });
+      assertTrue(_tableConfig.getIndexingConfig().isNullHandlingEnabled());
     }
   }
 
diff --git a/pinot-segment-local/src/test/java/org/apache/pinot/segment/local/segment/index/dictionary/DictionaryIndexTypeTest.java b/pinot-segment-local/src/test/java/org/apache/pinot/segment/local/segment/index/dictionary/DictionaryIndexTypeTest.java
index 819812496e..8e3db4f99b 100644
--- a/pinot-segment-local/src/test/java/org/apache/pinot/segment/local/segment/index/dictionary/DictionaryIndexTypeTest.java
+++ b/pinot-segment-local/src/test/java/org/apache/pinot/segment/local/segment/index/dictionary/DictionaryIndexTypeTest.java
@@ -224,27 +224,56 @@ public class DictionaryIndexTypeTest {
     }
 
     @Test
-    public void oldToNewConfConversion()
+    public void oldToNewConfConversionWithOnHeap()
         throws IOException {
-      _tableConfig.getIndexingConfig().setNoDictionaryColumns(
-          JsonUtils.stringToObject("[\"dimInt\"]", _stringListTypeRef)
-      );
       _tableConfig.getIndexingConfig()
           .setOnHeapDictionaryColumns(JsonUtils.stringToObject("[\"dimInt\"]", _stringListTypeRef));
+      convertToUpdatedFormat();
+      FieldConfig fieldConfig = getFieldConfigByColumn("dimInt");
+      DictionaryIndexConfig config = JsonUtils.jsonNodeToObject(
+          fieldConfig.getIndexes().get(StandardIndexes.dictionary().getPrettyName()),
+          DictionaryIndexConfig.class);
+      assertNotNull(config);
+      assertTrue(config.isOnHeap());
+      postConversionAsserts();
+    }
+
+    @Test
+    public void oldToNewConfConversionWithVarLength()
+        throws IOException {
       _tableConfig.getIndexingConfig()
           .setVarLengthDictionaryColumns(JsonUtils.stringToObject("[\"dimInt\"]", _stringListTypeRef));
-      _tableConfig.getIndexingConfig().setNoDictionaryConfig(
-          JsonUtils.stringToObject("{\"dimInt\": \"RAW\"}",
-              new TypeReference<Map<String, String>>() {
-              })
+      convertToUpdatedFormat();
+      FieldConfig fieldConfig = getFieldConfigByColumn("dimInt");
+      DictionaryIndexConfig config = JsonUtils.jsonNodeToObject(
+          fieldConfig.getIndexes().get(StandardIndexes.dictionary().getPrettyName()),
+          DictionaryIndexConfig.class);
+      assertNotNull(config);
+      assertTrue(config.getUseVarLengthDictionary());
+      postConversionAsserts();
+    }
+
+    @Test
+    public void oldToNewConfConversionWithNoDictionaryColumns()
+        throws IOException {
+      _tableConfig.getIndexingConfig().setNoDictionaryColumns(
+          JsonUtils.stringToObject("[\"dimInt\"]", _stringListTypeRef)
       );
       convertToUpdatedFormat();
+      FieldConfig fieldConfig = getFieldConfigByColumn("dimInt");
+      Assert.assertEquals(fieldConfig.getEncodingType(), FieldConfig.EncodingType.RAW);
+      postConversionAsserts();
+    }
+
+    private FieldConfig getFieldConfigByColumn(String column) {
       assertNotNull(_tableConfig.getFieldConfigList());
       assertFalse(_tableConfig.getFieldConfigList().isEmpty());
-      FieldConfig fieldConfig = _tableConfig.getFieldConfigList().stream()
-          .filter(fc -> fc.getName().equals("dimInt"))
+      return _tableConfig.getFieldConfigList().stream()
+          .filter(fc -> fc.getName().equals(column))
           .collect(Collectors.toList()).get(0);
-      assertNotNull(fieldConfig.getIndexes().get(new DictionaryIndexType().getPrettyName()));
+    }
+
+    private void postConversionAsserts() {
       assertNull(_tableConfig.getIndexingConfig().getNoDictionaryColumns());
       assertNull(_tableConfig.getIndexingConfig().getOnHeapDictionaryColumns());
       assertNull(_tableConfig.getIndexingConfig().getVarLengthDictionaryColumns());
diff --git a/pinot-segment-local/src/test/java/org/apache/pinot/segment/local/segment/index/forward/ForwardIndexTypeTest.java b/pinot-segment-local/src/test/java/org/apache/pinot/segment/local/segment/index/forward/ForwardIndexTypeTest.java
index bcfece6be5..b686d69ba8 100644
--- a/pinot-segment-local/src/test/java/org/apache/pinot/segment/local/segment/index/forward/ForwardIndexTypeTest.java
+++ b/pinot-segment-local/src/test/java/org/apache/pinot/segment/local/segment/index/forward/ForwardIndexTypeTest.java
@@ -278,7 +278,8 @@ public class ForwardIndexTypeTest {
         throws JsonProcessingException {
       addFieldIndexConfig(""
           + " {\n"
-          + "    \"name\": \"dimInt\","
+          + "    \"name\": \"dimInt\",\n"
+          + "    \"compressionCodec\": \"PASS_THROUGH\",\n"
           + "    \"encodingType\": \"RAW\"\n"
           + " }"
       );
diff --git a/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/AbstractIndexType.java b/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/AbstractIndexType.java
index e3c2afbedd..110360cee4 100644
--- a/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/AbstractIndexType.java
+++ b/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/AbstractIndexType.java
@@ -81,20 +81,25 @@ public abstract class AbstractIndexType<C extends IndexConfig, IR extends IndexR
     Map<String, FieldConfig> fieldConfigMap = fieldConfigList.stream()
         .collect(Collectors.toMap(FieldConfig::getName, Function.identity()));
     for (Map.Entry<String, C> entry : deserialize.entrySet()) {
+      C configValue = entry.getValue();
+      if (configValue.equals(getDefaultConfig())) {
+        continue;
+      }
       FieldConfig fieldConfig = fieldConfigMap.get(entry.getKey());
       if (fieldConfig != null) {
         ObjectNode currentIndexes = fieldConfig.getIndexes().isNull()
             ? new ObjectMapper().createObjectNode()
             : new ObjectMapper().valueToTree(fieldConfig.getIndexes());
-        JsonNode indexes = currentIndexes.set(getPrettyName(), entry.getValue().toJsonNode());
+        JsonNode indexes = currentIndexes.set(getPrettyName(), configValue.toJsonNode());
         FieldConfig.Builder builder = new FieldConfig.Builder(fieldConfig);
         builder.withIndexes(indexes);
         fieldConfigList.remove(fieldConfig);
         fieldConfigList.add(builder.build());
       } else {
-        JsonNode indexes = new ObjectMapper().createObjectNode().set(getPrettyName(), entry.getValue().toJsonNode());
+        JsonNode indexes = new ObjectMapper().createObjectNode().set(getPrettyName(), configValue.toJsonNode());
         FieldConfig.Builder builder = new FieldConfig.Builder(entry.getKey());
         builder.withIndexes(indexes);
+        builder.withEncodingType(FieldConfig.EncodingType.DICTIONARY);
         fieldConfigList.add(builder.build());
       }
     }
diff --git a/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/RangeIndexConfig.java b/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/RangeIndexConfig.java
index dab9ec72e1..ba5d67eda9 100644
--- a/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/RangeIndexConfig.java
+++ b/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/RangeIndexConfig.java
@@ -21,6 +21,7 @@ package org.apache.pinot.segment.spi.index;
 
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.Objects;
 import javax.annotation.Nullable;
 import org.apache.pinot.spi.config.table.IndexConfig;
 
@@ -45,4 +46,24 @@ public class RangeIndexConfig extends IndexConfig {
   public int getVersion() {
     return _version;
   }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+    if (!super.equals(o)) {
+      return false;
+    }
+    RangeIndexConfig that = (RangeIndexConfig) o;
+    return _version == that._version;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(super.hashCode(), _version);
+  }
 }
diff --git a/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/TextIndexConfig.java b/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/TextIndexConfig.java
index 291884f656..9086853cbc 100644
--- a/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/TextIndexConfig.java
+++ b/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/TextIndexConfig.java
@@ -25,6 +25,7 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import javax.annotation.Nullable;
 import org.apache.pinot.spi.config.table.FSTType;
 import org.apache.pinot.spi.config.table.IndexConfig;
@@ -133,4 +134,28 @@ public class TextIndexConfig extends IndexConfig {
       return this;
     }
   }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+    if (!super.equals(o)) {
+      return false;
+    }
+    TextIndexConfig that = (TextIndexConfig) o;
+    return _enableQueryCache == that._enableQueryCache && _useANDForMultiTermQueries == that._useANDForMultiTermQueries
+        && _fstType == that._fstType && Objects.equals(_rawValueForTextIndex, that._rawValueForTextIndex)
+        && Objects.equals(_stopWordsInclude, that._stopWordsInclude) && Objects.equals(_stopWordsExclude,
+        that._stopWordsExclude);
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(super.hashCode(), _fstType, _rawValueForTextIndex, _enableQueryCache,
+        _useANDForMultiTermQueries, _stopWordsInclude, _stopWordsExclude);
+  }
 }
diff --git a/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/creator/H3IndexConfig.java b/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/creator/H3IndexConfig.java
index cb2fed927a..bde1e8c9c9 100644
--- a/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/creator/H3IndexConfig.java
+++ b/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/creator/H3IndexConfig.java
@@ -24,6 +24,7 @@ import com.google.common.base.Preconditions;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+import java.util.Objects;
 import javax.annotation.Nullable;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.pinot.segment.spi.index.reader.H3IndexResolution;
@@ -66,4 +67,24 @@ public class H3IndexConfig extends IndexConfig {
   public H3IndexResolution getResolution() {
     return _resolution;
   }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+    if (!super.equals(o)) {
+      return false;
+    }
+    H3IndexConfig that = (H3IndexConfig) o;
+    return Objects.equals(_resolution, that._resolution);
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(super.hashCode(), _resolution);
+  }
 }
diff --git a/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/reader/H3IndexResolution.java b/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/reader/H3IndexResolution.java
index 8a48f7218c..8e2708bc5e 100644
--- a/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/reader/H3IndexResolution.java
+++ b/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/reader/H3IndexResolution.java
@@ -22,6 +22,7 @@ import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Objects;
 
 
 /**
@@ -73,4 +74,21 @@ public class H3IndexResolution {
   public int getLowestResolution() {
     return Integer.numberOfTrailingZeros(_resolutions);
   }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+    H3IndexResolution that = (H3IndexResolution) o;
+    return _resolutions == that._resolutions;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(_resolutions);
+  }
 }
diff --git a/pinot-spi/src/main/java/org/apache/pinot/spi/config/table/IndexConfig.java b/pinot-spi/src/main/java/org/apache/pinot/spi/config/table/IndexConfig.java
index 60572da640..16d9a47fb0 100644
--- a/pinot-spi/src/main/java/org/apache/pinot/spi/config/table/IndexConfig.java
+++ b/pinot-spi/src/main/java/org/apache/pinot/spi/config/table/IndexConfig.java
@@ -21,6 +21,7 @@ package org.apache.pinot.spi.config.table;
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.annotation.JsonIgnore;
 import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.Objects;
 import org.apache.pinot.spi.config.BaseJsonConfig;
 
 
@@ -52,4 +53,21 @@ public class IndexConfig extends BaseJsonConfig {
   public boolean isEnabled() {
     return !_disabled;
   }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+    IndexConfig that = (IndexConfig) o;
+    return _disabled == that._disabled;
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(_disabled);
+  }
 }
diff --git a/pinot-spi/src/main/java/org/apache/pinot/spi/config/table/JsonIndexConfig.java b/pinot-spi/src/main/java/org/apache/pinot/spi/config/table/JsonIndexConfig.java
index 85079d76da..fbb848f6be 100644
--- a/pinot-spi/src/main/java/org/apache/pinot/spi/config/table/JsonIndexConfig.java
+++ b/pinot-spi/src/main/java/org/apache/pinot/spi/config/table/JsonIndexConfig.java
@@ -21,6 +21,7 @@ package org.apache.pinot.spi.config.table;
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import com.google.common.base.Preconditions;
+import java.util.Objects;
 import java.util.Set;
 import javax.annotation.Nullable;
 
@@ -128,4 +129,28 @@ public class JsonIndexConfig extends IndexConfig {
   public void setExcludeFields(@Nullable Set<String> excludeFields) {
     _excludeFields = excludeFields;
   }
+
+  @Override
+  public boolean equals(Object o) {
+    if (this == o) {
+      return true;
+    }
+    if (o == null || getClass() != o.getClass()) {
+      return false;
+    }
+    if (!super.equals(o)) {
+      return false;
+    }
+    JsonIndexConfig config = (JsonIndexConfig) o;
+    return _maxLevels == config._maxLevels && _excludeArray == config._excludeArray
+        && _disableCrossArrayUnnest == config._disableCrossArrayUnnest && Objects.equals(_includePaths,
+        config._includePaths) && Objects.equals(_excludePaths, config._excludePaths) && Objects.equals(_excludeFields,
+        config._excludeFields);
+  }
+
+  @Override
+  public int hashCode() {
+    return Objects.hash(super.hashCode(), _maxLevels, _excludeArray, _disableCrossArrayUnnest, _includePaths,
+        _excludePaths, _excludeFields);
+  }
 }


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