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

Jackie-Jiang 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 1a6bb35365b Honor tier overwrites in 
IndexLoadingConfig.isSkipSegmentPreprocess (#19391)
1a6bb35365b is described below

commit 1a6bb35365b1738de7c1a696fc519a6a217f6834
Author: Chaitanya Deepthi <[email protected]>
AuthorDate: Fri Aug 28 16:24:54 2026 -0700

    Honor tier overwrites in IndexLoadingConfig.isSkipSegmentPreprocess (#19391)
---
 .../segment/index/loader/IndexLoadingConfig.java   |  7 ++++-
 .../index/loader/IndexLoadingConfigTest.java       | 31 ++++++++++++++++++++++
 2 files changed, 37 insertions(+), 1 deletion(-)

diff --git 
a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/IndexLoadingConfig.java
 
b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/IndexLoadingConfig.java
index dc552bca7a9..3782f3abbf8 100644
--- 
a/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/IndexLoadingConfig.java
+++ 
b/pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/loader/IndexLoadingConfig.java
@@ -87,6 +87,7 @@ public class IndexLoadingConfig {
   private List<StarTreeIndexConfig> _starTreeIndexConfigs;
   private boolean _enableDefaultStarTree;
   private Map<String, FieldIndexConfigs> _indexConfigsByColName = new 
HashMap<>();
+  private boolean _skipSegmentPreprocess;
 
   private boolean _dirty = true;
 
@@ -216,6 +217,7 @@ public class IndexLoadingConfig {
     _starTreeIndexConfigs = indexingConfig.getStarTreeIndexConfigs();
     _enableDefaultStarTree = indexingConfig.isEnableDefaultStarTree();
     _multiColTextIndexConfig = indexingConfig.getMultiColumnTextIndexConfig();
+    _skipSegmentPreprocess = indexingConfig.isSkipSegmentPreprocess();
     _dirty = false;
   }
 
@@ -350,7 +352,10 @@ public class IndexLoadingConfig {
   }
 
   public boolean isSkipSegmentPreprocess() {
-    return _tableConfig != null && 
_tableConfig.getIndexingConfig().isSkipSegmentPreprocess();
+    if (_dirty) {
+      refreshIndexConfigs();
+    }
+    return _skipSegmentPreprocess;
   }
 
   @Nullable
diff --git 
a/pinot-segment-local/src/test/java/org/apache/pinot/segment/local/segment/index/loader/IndexLoadingConfigTest.java
 
b/pinot-segment-local/src/test/java/org/apache/pinot/segment/local/segment/index/loader/IndexLoadingConfigTest.java
index 13beb081d11..4edb1c383cf 100644
--- 
a/pinot-segment-local/src/test/java/org/apache/pinot/segment/local/segment/index/loader/IndexLoadingConfigTest.java
+++ 
b/pinot-segment-local/src/test/java/org/apache/pinot/segment/local/segment/index/loader/IndexLoadingConfigTest.java
@@ -156,6 +156,37 @@ public class IndexLoadingConfigTest {
     assertFalse(fieldCfgs.getConfig(StandardIndexes.dictionary()).isEnabled());
   }
 
+  @Test
+  public void testSkipSegmentPreprocessRespectsTierOverwrites()
+      throws IOException {
+    InstanceDataManagerConfig idmCfg = mock(InstanceDataManagerConfig.class);
+    when(idmCfg.getConfig()).thenReturn(new PinotConfiguration());
+    Schema schema =
+        new 
Schema.SchemaBuilder().setSchemaName(TABLE_NAME).addSingleValueDimension("col1",
 FieldSpec.DataType.INT)
+            .build();
+    // Table-level skipSegmentPreprocess=true; override to false on 
"preprocessed" tier.
+    TableConfig tableConfig = new 
TableConfigBuilder(TableType.OFFLINE).setTableName(TABLE_NAME)
+        .setSkipSegmentPreprocess(true)
+        .setTierOverwrites(JsonUtils.stringToJsonNode("{\"preprocessed\": 
{\"skipSegmentPreprocess\": false}}"))
+        .build();
+
+    IndexLoadingConfig ilc = new IndexLoadingConfig(idmCfg, tableConfig, 
schema);
+    // Default tier: no override applied, table-level value flows through.
+    assertTrue(ilc.isSkipSegmentPreprocess());
+
+    // Unknown tier: no override for it, still falls back to table-level value.
+    ilc.setSegmentTier("someOtherTier");
+    assertTrue(ilc.isSkipSegmentPreprocess());
+
+    // "preprocessed" tier: override kicks in and flips the flag.
+    ilc.setSegmentTier("preprocessed");
+    assertFalse(ilc.isSkipSegmentPreprocess());
+
+    // Switching back to a tier without an override: table-level value again.
+    ilc.setSegmentTier(null);
+    assertTrue(ilc.isSkipSegmentPreprocess());
+  }
+
   @Test
   public void testCalculateForwardIndexConfig()
       throws JsonProcessingException {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to