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

   ## Summary
   - Add polymorphic `preModuloAbs(value)` for the `PRE_MODULO_ABS` 
normalization logic without divisor or modulo handling.
   - Add integral `mask(value)` for the `MASK` normalization logic by stripping 
the sign bit.
   - Cover scalar registration, SQL parsing, ingestion evaluator, and MSQ 
planner paths.
   
   ## User Manual
   `preModuloAbs(value)` converts a negative numeric value to a positive value. 
For integral minimum values, it returns `0` to match 
`PartitionIdNormalizer.PRE_MODULO_ABS` and avoid the `Math.abs` overflow corner.
   
   `mask(value)` supports `INT` and `LONG` inputs and clears the sign bit, 
matching `PartitionIdNormalizer.MASK` before callers apply modulo separately.
   
   ## Sample Queries
   ```sql
   SELECT preModuloAbs(hash_col) FROM myTable;
   SELECT mask(hash_col) FROM myTable;
   SELECT preModuloAbs(hash_col) % 16 AS partition_id FROM myTable;
   SELECT mask(hash_col) % 16 AS partition_id FROM myTable;
   ```
   
   ## Tests
   - `./mvnw -pl pinot-common -am 
-Dtest=ArithmeticScalarFunctionTest,CalciteSqlCompilerTest 
-Dsurefire.failIfNoSpecifiedTests=false test`
   - `./mvnw -pl pinot-core -am 
-Dtest=org.apache.pinot.core.data.function.ArithmeticFunctionsTest 
-Dsurefire.failIfNoSpecifiedTests=false test`
   - `./mvnw -pl pinot-query-planner -am 
-Dtest=org.apache.pinot.query.QueryCompilationTest#testPolymorphicArithmeticScalarFunctionsPlanQuery
 -Dsurefire.failIfNoSpecifiedTests=false test`
   - `./mvnw spotless:apply checkstyle:check license:format license:check -pl 
pinot-common,pinot-core,pinot-query-planner,pinot-integration-tests`
   - `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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to