You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "xiangfu0 (via GitHub)" <gi...@apache.org> on 2026/06/03 18:57:44 UTC

[PR] [codex] Deprecate field-level forward encoding [pinot]

xiangfu0 opened a new pull request, #18668:
URL: https://github.com/apache/pinot/pull/18668

   ## Summary
   
   Deprecates field-level `FieldConfig.encodingType` as the canonical forward-index encoding source and moves canonical reads/writes to `fieldConfig.indexes.forward.encodingType`.
   
   This keeps legacy configs backward-compatible:
   
   - `fieldConfig.encodingType` still deserializes and `getEncodingType()` still defaults missing values to `DICTIONARY` for existing callers.
   - `noDictionaryColumns`, `noDictionaryConfig`, and top-level `encodingType` remain fallback inputs when `indexes.forward.encodingType` is absent.
   - When `indexes.forward.encodingType` is present, it wins over the deprecated field-level value and no-dictionary legacy signals.
   
   ## User Manual
   
   For new table configs, configure forward-index encoding under the `forward` index block:
   
   ```json
   {
     "fieldConfigList": [
       {
         "name": "message",
         "indexes": {
           "forward": {
             "encodingType": "RAW",
             "compressionCodec": "ZSTANDARD"
           }
         }
       }
     ]
   }
   ```
   
   Existing configs using top-level `encodingType` continue to work, but that field is now deprecated:
   
   ```json
   {
     "fieldConfigList": [
       {
         "name": "message",
         "encodingType": "RAW"
       }
     ]
   }
   ```
   
   If both are present, `indexes.forward.encodingType` is authoritative:
   
   ```json
   {
     "fieldConfigList": [
       {
         "name": "message",
         "encodingType": "RAW",
         "indexes": {
           "forward": {
             "encodingType": "DICTIONARY"
           }
         }
       }
     ]
   }
   ```
   
   In that example, Pinot resolves the forward index as `DICTIONARY` encoded.
   
   ## Sample Table Config
   
   ```json
   {
     "tableName": "logs_OFFLINE",
     "tableType": "OFFLINE",
     "segmentsConfig": {
       "schemaName": "logs"
     },
     "tableIndexConfig": {},
     "fieldConfigList": [
       {
         "name": "logLine",
         "indexes": {
           "forward": {
             "encodingType": "RAW",
             "compressionCodec": "ZSTANDARD"
           },
           "text": {}
         }
       },
       {
         "name": "statusCode",
         "indexes": {
           "forward": {
             "encodingType": "DICTIONARY"
           },
           "inverted": {}
         }
       }
     ]
   }
   ```
   
   ## Validation
   
   - `./mvnw -pl pinot-segment-local -Dtest=ForwardIndexTypeTest,DictionaryIndexTypeTest,TableConfigUtilsTest test`
   - `./mvnw -pl pinot-segment-local -Dtest=DictionaryIndexTypeTest test`
   - `./mvnw -pl pinot-segment-spi -Dtest=ForwardIndexConfigTest test`
   - `./mvnw -pl pinot-spi -Dtest=FieldConfigTest,OpenStructIndexConfigTest test`
   - `./mvnw spotless:apply -pl pinot-spi,pinot-segment-spi,pinot-segment-local`
   - `./mvnw checkstyle:check -pl pinot-spi,pinot-segment-spi,pinot-segment-local`
   - `./mvnw license:format -pl pinot-spi,pinot-segment-spi,pinot-segment-local`
   - `./mvnw license:check -pl pinot-spi,pinot-segment-spi,pinot-segment-local`
   
   `license:check` passes with pre-existing unknown-extension warnings for Lucene binary test resources under `pinot-segment-local/src/test/resources/data/lucene_80_index`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [deprecation] Deprecate field-level forward index settings [pinot]

Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 commented on PR #18668:
URL: https://github.com/apache/pinot/pull/18668#issuecomment-6510403395

   Rebased onto apache/pinot master c91d0e8378; remaining review fixes are in dbf0005ffe.
   
   Chose soft deprecation so existing configs remain editable and keep working on older nodes during upgrades/rollback. Automatic removal of legacy RAW would break older forward-index readers, and legacy properties still have runtime consumers. Added since/forRemoval metadata, corrected compression documentation, and restored rejection of explicit RAW versus canonical DICTIONARY conflicts.
   
   Validation passed: SPI serialization/config regressions, 68 nested forward/dictionary tests, table-config and consuming-tier tests, the controller GET/edit/PUT regression, integration-test source compilation, scoped Spotless/Checkstyle/license checks, and independent code review. CI is running on the pushed head.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [deprecation] Add opt-in migration for legacy field configs [pinot]

Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 commented on PR #18668:
URL: https://github.com/apache/pinot/pull/18668#issuecomment-6513498123

   Fixed the Unit Test Set 2 failure in 796dedc132. TestNG selected its Iterable overload for JsonNode assertions, making equal property objects depend on iteration order and scalar codec comparisons vacuous. The three affected assertions now select structural JsonNode equality.
   
   Validation: all 108 tests in TableConfigsRestletResourceTest and TableConfigUtilsTest passed, as did scoped Spotless, license, Checkstyle and warning-enabled compilation. A deterministic reproduction confirms reordered equal objects pass and different codec values fail. Independent review approved the test-only change. The prior head passed the other 12 checks; CI is restarting on this head.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [deprecation] Block field-level forward encoding in table configs [pinot]

Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 commented on code in PR #18668:
URL: https://github.com/apache/pinot/pull/18668#discussion_r3366413238


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/dictionary/DictionaryIndexType.java:
##########
@@ -178,8 +180,22 @@ private static boolean hasExplicitDictionaryConfig(FieldConfig fieldConfig) {
     return indexes != null && indexes.isObject() && indexes.has(StandardIndexes.DICTIONARY_ID);
   }
 
+  private static FieldConfig.EncodingType getForwardEncodingType(FieldConfig fieldConfig) {

Review Comment:
   Addressed in the amended head `3e3615f`: `ForwardIndexType` now owns `ENCODING_TYPE_CONFIG_KEY`, `getForwardEncodingType(FieldConfig)`, and `withForwardEncoding(...)`; `DictionaryIndexType` uses those instead of re-parsing/writing `indexes.forward.encodingType` locally. The legacy fallback remains centralized there for conversion paths that still inspect configs before validation.



##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/TableConfigUtils.java:
##########
@@ -1594,11 +1593,13 @@ private static void validateIndexingConfigAndFieldConfigList(TableConfig tableCo
         String column = fieldConfig.getName();
         Preconditions.checkState(seenColumns.add(column), "Duplicate FieldConfig for column: %s", column);
         Preconditions.checkState(schema.hasColumn(column), "Failed to find column: %s in schema", column);
+        Preconditions.checkState(!fieldConfig.hasFieldLevelEncodingType(),

Review Comment:
   Intentional hard break: table create/update should reject field-level `fieldConfigList[].encodingType` and direct users to `fieldConfigList[].indexes.forward.encodingType`. I updated the PR description and README/manual text to state that explicitly, including the validation error and sample config. The legacy field still deserializes for read/conversion paths, but submitted table configs are expected to migrate before create/update validation.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [deprecation] Block field-level forward encoding in table configs [pinot]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #18668:
URL: https://github.com/apache/pinot/pull/18668#discussion_r3450291104


##########
pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/index/FieldIndexConfigsUtil.java:
##########
@@ -80,6 +80,24 @@ public static FieldIndexConfigs fromFieldConfig(@Nullable FieldConfig fieldConfi
     return builder.build();
   }
 
+  @SuppressWarnings("deprecation")
+  private static boolean isRawForwardEncoded(@Nullable FieldConfig fieldConfig) {
+    if (fieldConfig == null) {
+      return false;
+    }
+    JsonNode indexes = fieldConfig.getIndexes();
+    JsonNode forward = indexes != null ? indexes.get("forward") : null;
+    if (forward != null && forward.isObject()) {
+      try {
+        return JsonUtils.jsonNodeToObject(forward, ForwardIndexConfig.class).getEncodingType()
+            == FieldConfig.EncodingType.RAW;
+      } catch (IOException e) {
+        throw new IllegalArgumentException("Failed to parse forward index config from FieldConfig", e);
+      }
+    }
+    return fieldConfig.getEncodingType() == FieldConfig.EncodingType.RAW;
+  }

Review Comment:
   `FieldIndexConfigsUtil.fromFieldConfig()` is documented as deriving the dictionary setting from `fieldConfig.indexes.forward.encodingType` and using legacy signals only as a fallback. However, `isRawForwardEncoded()` currently parses the whole `forward` block into `ForwardIndexConfig`, which defaults `encodingType` to `DICTIONARY` when absent. This means a config that has a `forward` block (e.g. for compression) but omits `encodingType` will *never* fall back to the deprecated field-level `encodingType` (or other legacy signals) and will be treated as DICTIONARY-encoded even if the legacy field-level value is `RAW`.
   
   This can break the stated backward-compat behavior for legacy inputs where `indexes.forward.encodingType` is missing. Consider checking the raw `forward.encodingType` field directly and only using it when explicitly present; otherwise fall back to `fieldConfig.getEncodingType()`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [deprecation] Block field-level forward encoding in table configs [pinot]

Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 commented on code in PR #18668:
URL: https://github.com/apache/pinot/pull/18668#discussion_r4397759594


##########
pinot-spi/src/main/java/org/apache/pinot/spi/config/table/FieldConfig.java:
##########
@@ -242,6 +272,7 @@ public JsonNode getTierOverwrites() {
   /// Returns the raw forward-index compression codec, or `null` when using `codecSpec` or the
   /// default. Still the only way to express `MV_ENTRY_DICT` and the CLP family — not deprecated.
   @Nullable
+  @Deprecated

Review Comment:
   Minor: the doc two lines up still says "Still the only way to express `MV_ENTRY_DICT` and the CLP family — not deprecated", which now contradicts this `@Deprecated` and the validation reject. `indexes.forward.compressionCodec` accepts the full `CompressionCodec` enum (see `ForwardIndexConfig`'s ctor), so the claim is stale — worth rewording to point there.



##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/TableConfigUtils.java:
##########
@@ -2047,11 +2047,16 @@ private static void validateIndexingConfigAndFieldConfigList(TableConfig tableCo
         String column = fieldConfig.getName();
         Preconditions.checkState(seenColumns.add(column), "Duplicate FieldConfig for column: %s", column);
         Preconditions.checkState(schema.hasColumn(column), "Failed to find column: %s in schema", column);
-
-        // Validate DELTA / DELTADELTA compression codecs compatibility
-        validateGorillaCompressionCodecIfPresent(fieldConfig, schema.getFieldSpecFor(column));
+        Preconditions.checkState(!fieldConfig.hasFieldLevelEncodingType(),
+            "FieldConfig.encodingType is deprecated for column: %s. Use fieldConfigList[].indexes.forward.encodingType "

Review Comment:
   **MAJOR — this breaks config updates for every pre-upgrade table with a `fieldConfigList`, not just ones that used field-level encoding.** Verified locally (pinot-spi built at base `b58776b` vs this head): the old `FieldConfig` ctor defaulted null→`DICTIONARY` and serialized the getter, so every persisted config carries serializer-injected `"encodingType":"DICTIONARY"`; on this head that deserializes to `hasFieldLevelEncodingType()==true` and any update (even GET→edit→PUT of an unrelated field) fails here until the operator hand-strips the field.
   
   Suggest tolerating `DICTIONARY` when `indexes.forward.encodingType` is absent or agrees (reject only `RAW`/true conflicts), or auto-rewriting on read as Jackie suggested — a bare reject needs at least a release-note-level migration callout.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [deprecation] Block field-level forward encoding in table configs [pinot]

Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 commented on PR #18668:
URL: https://github.com/apache/pinot/pull/18668#issuecomment-4755455935

   Addressed in the rebased head `311391ca02`: field-level `compressionCodec` and `properties` are now deprecated alongside `encodingType`, table create/update validation rejects them with migration guidance, and `createTableConfigFromOldFormat` clears them after moving internal settings into `indexes.*`. I also migrated the affected tests and sample configs to `indexes.forward`, `indexes.h3`, `indexes.text`, and `indexes.vector` as appropriate.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [deprecation] Add opt-in migration for legacy field configs [pinot]

Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 commented on PR #18668:
URL: https://github.com/apache/pinot/pull/18668#issuecomment-6511693573

   Added opt-in automatic migration in 7ba39a6a19. After all readers are upgraded, set `controller.table.config.auto.migrate.legacy.fields.enabled=true`; create/update saves canonical settings and validation previews them, while the default preserves rolling-upgrade compatibility.
   
   Unknown properties, tier overrides and legacy-disabled forward settings are preserved. Fixed canonical CLP stats and text JSON round trips so migration retains effective behavior.
   
   All 110 targeted tests and scoped checks passed; independent source review found no remaining blockers.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [codex] Deprecate field-level forward encoding [pinot]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #18668:
URL: https://github.com/apache/pinot/pull/18668#issuecomment-4616603445

   ## [Codecov](https://app.codecov.io/gh/apache/pinot/pull/18668?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `25.92593%` with `20 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 56.88%. Comparing base ([`b50a421`](https://app.codecov.io/gh/apache/pinot/commit/b50a421740aa0749d63a12e2740595dccac21c37?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`3b9a7b8`](https://app.codecov.io/gh/apache/pinot/commit/3b9a7b8a1c96777bf186d1ac65518a3be41f22d3?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 1 commits behind head on master.
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/pinot/pull/18668?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [.../segment/index/dictionary/DictionaryIndexType.java](https://app.codecov.io/gh/apache/pinot/pull/18668?src=pr&el=tree&filepath=pinot-segment-local%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fsegment%2Flocal%2Fsegment%2Findex%2Fdictionary%2FDictionaryIndexType.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3Qtc2VnbWVudC1sb2NhbC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3Qvc2VnbWVudC9sb2NhbC9zZWdtZW50L2luZGV4L2RpY3Rpb25hcnkvRGljdGlvbmFyeUluZGV4VHlwZS5qYXZh) | 17.39% | [17 Missing and 2 partials :warning: ](https://app.codecov.io/gh/apache/pinot/pull/18668?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [.../local/segment/index/forward/ForwardIndexType.java](https://app.codecov.io/gh/apache/pinot/pull/18668?src=pr&el=tree&filepath=pinot-segment-local%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fsegment%2Flocal%2Fsegment%2Findex%2Fforward%2FForwardIndexType.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3Qtc2VnbWVudC1sb2NhbC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3Qvc2VnbWVudC9sb2NhbC9zZWdtZW50L2luZGV4L2ZvcndhcmQvRm9yd2FyZEluZGV4VHlwZS5qYXZh) | 50.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/pinot/pull/18668?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   > :exclamation:  There is a different number of reports uploaded between BASE (b50a421) and HEAD (3b9a7b8). Click for more details.
   > 
   > <details><summary>HEAD has 16 uploads less than BASE</summary>
   >
   >| Flag | BASE (b50a421) | HEAD (3b9a7b8) |
   >|------|------|------|
   >|java-21|5|1|
   >|unittests|2|1|
   >|temurin|5|1|
   >|unittests2|1|0|
   >|integration|3|0|
   >|integration1|1|0|
   >|integration2|1|0|
   >|custom-integration1|1|0|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #18668      +/-   ##
   ============================================
   - Coverage     64.43%   56.88%   -7.56%     
   + Complexity     1291        1    -1290     
   ============================================
     Files          3367     2579     -788     
     Lines        208380   149958   -58422     
     Branches      32549    24242    -8307     
   ============================================
   - Hits         134274    85301   -48973     
   + Misses        63306    57444    -5862     
   + Partials      10800     7213    -3587     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/pinot/pull/18668/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [custom-integration1](https://app.codecov.io/gh/apache/pinot/pull/18668/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [integration](https://app.codecov.io/gh/apache/pinot/pull/18668/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [integration1](https://app.codecov.io/gh/apache/pinot/pull/18668/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [integration2](https://app.codecov.io/gh/apache/pinot/pull/18668/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [java-21](https://app.codecov.io/gh/apache/pinot/pull/18668/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.88% <25.92%> (-7.56%)` | :arrow_down: |
   | [temurin](https://app.codecov.io/gh/apache/pinot/pull/18668/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.88% <25.92%> (-7.56%)` | :arrow_down: |
   | [unittests](https://app.codecov.io/gh/apache/pinot/pull/18668/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.88% <25.92%> (-7.56%)` | :arrow_down: |
   | [unittests1](https://app.codecov.io/gh/apache/pinot/pull/18668/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.88% <25.92%> (+0.02%)` | :arrow_up: |
   | [unittests2](https://app.codecov.io/gh/apache/pinot/pull/18668/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/pinot/pull/18668?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [deprecation] Block field-level forward encoding in table configs [pinot]

Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 commented on PR #18668:
URL: https://github.com/apache/pinot/pull/18668#issuecomment-4712226231

   Addressed the remaining update-path/compatibility-verifier notes in the rebased head `864cfa1221` while keeping the intentional hard-reject behavior:
   
   - Added `TableConfigsRestletResourceTest#testUpdateRejectsStoredLegacyFieldLevelEncodingType`, which seeds a legacy stored config and verifies a new-controller table-config update rejects field-level `encodingType` with the migration message.
   - Updated the top-level README to state that create/update validation rejects `fieldConfigList[].encodingType` and that existing configs must be migrated before submission.
   - Added a compatibility-verifier README note explaining why those fixtures intentionally keep field-level `encodingType`: they are submitted to the older controller before the upgrade, where `fieldConfigList[].indexes.forward.encodingType` is not understood. They are not examples for configs submitted to new controllers.
   
   Local validation:
   - `./mvnw -pl pinot-controller -am -Dtest=TableConfigsRestletResourceTest#testUpdateRejectsStoredLegacyFieldLevelEncodingType -Dsurefire.failIfNoSpecifiedTests=false test`
   - `./mvnw spotless:apply -pl pinot-controller`
   - `./mvnw license:format -pl pinot-controller`
   - `./mvnw checkstyle:check -pl pinot-controller`
   - `./mvnw license:check -pl pinot-controller`
   - `git diff --check`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [deprecation] Block field-level forward encoding in table configs [pinot]

Posted by "gortiz (via GitHub)" <gi...@apache.org>.
gortiz commented on PR #18668:
URL: https://github.com/apache/pinot/pull/18668#issuecomment-4647621154

   ## Review notes (non-blocking — flagging for maintainer consideration)
   
   I reviewed this PR focusing on the validation/serialization changes. CI is green, but I think the green is partly misleading (details below). Two things I'd like the maintainers to weigh in on before merge.
   
   ### 1. Update path for existing tables
   `TableConfigUtils.validate` unconditionally rejects any `FieldConfig` with a field-level `encodingType`, and that method runs on table **update** (`PinotTableRestletResource.java:364`) and the validate endpoint (`:868`), not just on create. Any deployment with a table whose **stored** config carries `fieldConfigList[].encodingType` — historically the documented and common form — would be unable to apply *any* subsequent config update until an operator manually rewrites it into `indexes.forward.encodingType`. No auto-migration runs on this path (`createTableConfigFromOldFormat` has no production callers).
   
   Suggestion: auto-rewrite the deprecated field into the forward block during validation/normalization and emit a deprecation warning, rather than hard-rejecting — or gate the rejection behind a flag / staged rollout with an explicit migration step. Per the repo's mixed-version compat mandate, removing an accepted config key on the write path probably wants a migration story (migration notes / rollback / flag), none of which is in the PR today.
   
   ### 2. CI green doesn't cover the break
   The compatibility-verifier suite creates tables on the *old* binary and never updates a legacy config on the *new* controller, so the update-path break above is unverified. Relatedly, those suite configs themselves still use the deprecated top-level form — e.g. `compatibility-verifier/sample-test-suite/config/feature-test-1.json:4` still has `"encodingType": "RAW"`. The PR migrated the pinot-tools samples and README but missed these. Worth either migrating them or documenting why the compat path is intentionally exempt. A regression test that updates a stored legacy config on the new controller would close the gap.
   
   ### Smaller notes
   - **Serialization shape change:** `FieldConfig` no longer defaults `_encodingType` to DICTIONARY and omits the key when unset. Self-roundtrip is tested; mixed-version (old broker/server reading a new-controller config that omits the key) is not.
   - **Silent precedence change:** `ForwardIndexType.createDeserializer` dropped the conflict check, so a config setting both field-level and forward-block encoding to *conflicting* values now silently uses the forward value instead of erroring.
   
   ### Positives
   - The `List`→`LinkedHashSet` change in `DictionaryIndexType.handleIndexSpecificCleanup` fixes a latent double-update bug.
   - The rejection message is excellent — it names the column and the exact replacement key.
   - README, UI, and pinot-tools sample configs were migrated consistently.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [deprecation] Deprecate field-level forward index settings [pinot]

Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 commented on code in PR #18668:
URL: https://github.com/apache/pinot/pull/18668#discussion_r4418734876


##########
pinot-spi/src/main/java/org/apache/pinot/spi/config/table/FieldConfig.java:
##########
@@ -216,8 +222,32 @@ public String getName() {
     return _name;
   }
 
+  /// Returns the legacy field-level forward-index encoding.
+  ///
+  /// Prefer configuring and reading `encodingType` from `indexes.forward`. This method keeps backward-compatible
+  /// defaulting for older configs: when the deprecated field-level value is absent, it returns `DICTIONARY`.
+  @JsonIgnore
+  @Deprecated

Review Comment:
   Addressed in dbf0005ffe: all new FieldConfig deprecations now specify since = "1.7.0" and forRemoval = true. Existing deprecations retain their historical versions (0.13.0 for the constructor and 0.9.0 for getIndexType).



##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/TableConfigUtils.java:
##########
@@ -2047,11 +2047,16 @@ private static void validateIndexingConfigAndFieldConfigList(TableConfig tableCo
         String column = fieldConfig.getName();
         Preconditions.checkState(seenColumns.add(column), "Duplicate FieldConfig for column: %s", column);
         Preconditions.checkState(schema.hasColumn(column), "Failed to find column: %s in schema", column);
-
-        // Validate DELTA / DELTADELTA compression codecs compatibility
-        validateGorillaCompressionCodecIfPresent(fieldConfig, schema.getFieldSpecFor(column));
+        Preconditions.checkState(!fieldConfig.hasFieldLevelEncodingType(),
+            "FieldConfig.encodingType is deprecated for column: %s. Use fieldConfigList[].indexes.forward.encodingType "

Review Comment:
   Addressed in dbf0005ffe by choosing soft deprecation, as Jackie suggested. Create/update validation accepts and preserves legacy encoding, compression, and properties, including serializer-injected DICTIONARY. Automatic removal of legacy RAW would make the config unreadable by older nodes, so it is deferred; genuine RAW versus canonical DICTIONARY conflicts still fail. The controller GET/edit-description/PUT regression passes for DICTIONARY, RAW plus SNAPPY, and legacy properties.



##########
pinot-spi/src/main/java/org/apache/pinot/spi/config/table/FieldConfig.java:
##########
@@ -242,6 +272,7 @@ public JsonNode getTierOverwrites() {
   /// Returns the raw forward-index compression codec, or `null` when using `codecSpec` or the
   /// default. Still the only way to express `MV_ENTRY_DICT` and the CLP family — not deprecated.
   @Nullable
+  @Deprecated

Review Comment:
   Addressed in dbf0005ffe: the getter documentation now points to indexes.forward.compressionCodec, including MV_ENTRY_DICT and the CLP family, and distinguishes codecSpec pipeline compression. Removed the stale "not deprecated" claim.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [deprecation] Block field-level forward encoding in table configs [pinot]

Posted by "xiangfu0 (via GitHub)" <gi...@apache.org>.
xiangfu0 commented on code in PR #18668:
URL: https://github.com/apache/pinot/pull/18668#discussion_r3365846313


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/segment/index/dictionary/DictionaryIndexType.java:
##########
@@ -178,8 +180,22 @@ private static boolean hasExplicitDictionaryConfig(FieldConfig fieldConfig) {
     return indexes != null && indexes.isObject() && indexes.has(StandardIndexes.DICTIONARY_ID);
   }
 
+  private static FieldConfig.EncodingType getForwardEncodingType(FieldConfig fieldConfig) {

Review Comment:
   **Minor — single-source the forward-encoding resolution.**
   
   This helper re-implements the `indexes.forward.encodingType` parse that `ForwardIndexType.createDeserializer` already does, and the JSON keys `"forward"`/`"encodingType"` are hardcoded here, in `withForwardEncoding` below, and in the test helpers. If the precedence/shape ever changes, these can drift. Consider one shared accessor (e.g. on `FieldConfig` or a forward-index util) plus a constant for the `"encodingType"` key, used by both resolvers.
   
   Also note the fallback `return fieldConfig.getEncodingType();` here is now mostly unreachable for explicit values once `validate()` forbids field-level encoding — worth reconciling with that validation so the legacy path isn't half-alive.
   



##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/TableConfigUtils.java:
##########
@@ -1594,11 +1593,13 @@ private static void validateIndexingConfigAndFieldConfigList(TableConfig tableCo
         String column = fieldConfig.getName();
         Preconditions.checkState(seenColumns.add(column), "Duplicate FieldConfig for column: %s", column);
         Preconditions.checkState(schema.hasColumn(column), "Failed to find column: %s in schema", column);
+        Preconditions.checkState(!fieldConfig.hasFieldLevelEncodingType(),

Review Comment:
   **Backward-compat: this hard-rejects the legacy field-level `encodingType` with no migration path.**
   
   `hasFieldLevelEncodingType()` is true whenever `encodingType` is explicitly set (`_encodingType != null`), so a long-standing config like `{"name":"col","encodingType":"RAW"}` now fails validation. `TableConfigUtils.validate` runs on the as-submitted config at create/update (`PinotTableRestletResource#868`, `TableConfigsRestletResource#594/604`) and nothing migrates field-level→forward beforehand (`createTableConfigFromOldFormat`/`convertFromLegacyTableConfig` are test-only). So editing any existing table that uses field-level `encodingType` is blocked until the user hand-migrates each column.
   
   This contradicts the PR description ("Existing configs using top-level `encodingType` continue to work"). Suggest either auto-migrating field-level→`indexes.forward.encodingType` on the write path *before* validation (true deprecation, no user impact), or — if the hard break is intended — labeling it `backward-incompat`/`release-notes`, adding rolling-upgrade notes, and updating the description.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [deprecation] Block field-level forward encoding in table configs [pinot]

Posted by "Jackie-Jiang (via GitHub)" <gi...@apache.org>.
Jackie-Jiang commented on code in PR #18668:
URL: https://github.com/apache/pinot/pull/18668#discussion_r4340612564


##########
pinot-spi/src/main/java/org/apache/pinot/spi/config/table/FieldConfig.java:
##########
@@ -216,8 +222,32 @@ public String getName() {
     return _name;
   }
 
+  /// Returns the legacy field-level forward-index encoding.
+  ///
+  /// Prefer configuring and reading `encodingType` from `indexes.forward`. This method keeps backward-compatible
+  /// defaulting for older configs: when the deprecated field-level value is absent, it returns `DICTIONARY`.
+  @JsonIgnore
+  @Deprecated

Review Comment:
   Please add since and forRemoval, same for other deprecated annotations



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [PR] [deprecation] Add opt-in migration for legacy field configs [pinot]

Posted by "xiangfu0 (via GitHub) via commits" <co...@pinot.apache.org>.
xiangfu0 commented on PR #18668:
URL: https://github.com/apache/pinot/pull/18668#issuecomment-6621974300

   I added a seven-slide walkthrough to the [PR description](https://github.com/apache/pinot/pull/18668#issue-4582782439). It shows a before-and-after table config, which settings migrate, and how to enable migration after upgrading all config readers.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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