You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "rsrkpatwari1234 (via GitHub)" <gi...@apache.org> on 2026/04/24 11:53:38 UTC

[PR] Deduplicate ExpressionTransformer and CustomFunctionEnricher function evaluation [pinot]

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

   Fixes #18216
   
   ## Motivation
   `ExpressionTransformer` and `CustomFunctionEnricher` both run transform-style function evaluation on `GenericRow`, with overlapping rules (e.g. how values are written and when evaluation runs). Inlining that logic in two places makes drift and bugs more likely.
   
   ## What changed
   - Introduced `IngestionFunctionEvaluation` as the single place for per-row behavior:
   -- `applyExpressionTransformations` — SPI FunctionEvaluator path used by the record-transformer chain (null/overwrite, implicit MAP-derived columns, continueOnError + throttled warning + incomplete row).
   -- `applyEnricherEvaluations` — segment-local FunctionEvaluator map, always-overwrite semantics for the enricher pipeline.
   - `ExpressionTransformer`: transform now delegates to `applyExpressionTransformations`; constructor/ordering/implicit-MAP discovery unchanged.
   - `CustomFunctionEnricher`: delegates enricher eval to `applyEnricherEvaluations` (Javadoc points at shared semantics).
   
   ## Testing
   Added `IngestionFunctionEvaluationTest` to cover unit tests


-- 
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] Deduplicate ExpressionTransformer and CustomFunctionEnricher function evaluation [pinot]

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

   ## [Codecov](https://app.codecov.io/gh/apache/pinot/pull/18321?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 `38.29787%` with `29 lines` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 55.57%. Comparing base ([`ab9ac39`](https://app.codecov.io/gh/apache/pinot/commit/ab9ac391fa16b731eb2e1498bb13cdaaf65e92da?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`794716e`](https://app.codecov.io/gh/apache/pinot/commit/794716e83e4e9b7e1c0144c8123b2965ba844f29?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/pinot/pull/18321?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...recordtransformer/IngestionFunctionEvaluation.java](https://app.codecov.io/gh/apache/pinot/pull/18321?src=pr&el=tree&filepath=pinot-segment-local%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fsegment%2Flocal%2Frecordtransformer%2FIngestionFunctionEvaluation.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3Qtc2VnbWVudC1sb2NhbC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3Qvc2VnbWVudC9sb2NhbC9yZWNvcmR0cmFuc2Zvcm1lci9Jbmdlc3Rpb25GdW5jdGlvbkV2YWx1YXRpb24uamF2YQ==) | 37.77% | [17 Missing and 11 partials :warning: ](https://app.codecov.io/gh/apache/pinot/pull/18321?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [...rmer/enricher/function/CustomFunctionEnricher.java](https://app.codecov.io/gh/apache/pinot/pull/18321?src=pr&el=tree&filepath=pinot-segment-local%2Fsrc%2Fmain%2Fjava%2Forg%2Fapache%2Fpinot%2Fsegment%2Flocal%2Frecordtransformer%2Fenricher%2Ffunction%2FCustomFunctionEnricher.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGlub3Qtc2VnbWVudC1sb2NhbC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcGlub3Qvc2VnbWVudC9sb2NhbC9yZWNvcmR0cmFuc2Zvcm1lci9lbnJpY2hlci9mdW5jdGlvbi9DdXN0b21GdW5jdGlvbkVucmljaGVyLmphdmE=) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/pinot/pull/18321?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 (ab9ac39) and HEAD (794716e). Click for more details.
   > 
   > <details><summary>HEAD has 28 uploads less than BASE</summary>
   >
   >| Flag | BASE (ab9ac39) | HEAD (794716e) |
   >|------|------|------|
   >|java-21|5|1|
   >|unittests1|2|1|
   >|unittests|4|1|
   >|temurin|8|1|
   >|unittests2|2|0|
   >|java-11|3|0|
   >|integration|4|0|
   >|integration1|1|0|
   >|integration2|2|0|
   >|custom-integration1|1|0|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #18321      +/-   ##
   ============================================
   - Coverage     63.61%   55.57%   -8.05%     
   + Complexity     1659      837     -822     
   ============================================
     Files          3246     2537     -709     
     Lines        197514   146196   -51318     
     Branches      30578    23542    -7036     
   ============================================
   - Hits         125656    81244   -44412     
   + Misses        61813    57956    -3857     
   + Partials      10045     6996    -3049     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/pinot/pull/18321/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/18321/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/18321/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/18321/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/18321/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   | [java-11](https://app.codecov.io/gh/apache/pinot/pull/18321/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/18321/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.57% <38.29%> (-8.02%)` | :arrow_down: |
   | [temurin](https://app.codecov.io/gh/apache/pinot/pull/18321/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.57% <38.29%> (-8.05%)` | :arrow_down: |
   | [unittests](https://app.codecov.io/gh/apache/pinot/pull/18321/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.57% <38.29%> (-8.05%)` | :arrow_down: |
   | [unittests1](https://app.codecov.io/gh/apache/pinot/pull/18321/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `55.57% <38.29%> (-0.02%)` | :arrow_down: |
   | [unittests2](https://app.codecov.io/gh/apache/pinot/pull/18321/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/18321?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] Deduplicate ExpressionTransformer and CustomFunctionEnricher function evaluation [pinot]

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

   The idea is use one function evaluator to process two side.
   Just moving the functions around and wrap it is not the purpose


-- 
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] Deduplicate ExpressionTransformer and CustomFunctionEnricher function evaluation [pinot]

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

   > The idea is to use one function evaluator to process two sides to consolidate & simplify the code. Just moving the functions around and wrap it is not the purpose
   
   Thanks for the clarification.
   
   Addressed this by one shared entry point, `IngestionFunctionEvaluation.applyFunctionEvaluations(record, evaluators, policy)`, with a single for over `Map<String, FunctionEvaluator>`. 
   
   Policy.enricher() vs Policy.expressionTransformation(...) only switches how each (column, evaluator) is applied (always putValue(evaluate) for the JSON enricher vs. null/overwrite/implicit-MAP/continueOnError/typed collection rules for ExpressionTransformer). 
   
   ExpressionTransformer and CustomFunctionEnricher both call that same method with the appropriate policy
   
   


-- 
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