Aatirhassanpir opened a new issue, #14898:
URL: https://github.com/apache/pinot/issues/14898

   
   ### Description
   The changes in this pull request address the handling of null literal values 
and their type information in the LiteralContext and LiteralTransform 
components. Specifically, the PR introduces the preservation of the type of 
literals, ensuring that numerical literals are passed down as long or double 
instead of being treated as strings. This behavior prevents issues with string 
representations of numbers (e.g., "123") being treated as numerical values.
   ### Changes Made
   Literal Context
   The type information of literals is now preserved. For example, numerical 
literals such as integers and decimals are no longer misinterpreted as strings. 
This change ensures that the correct data types are used downstream in the 
transformation functions.
   backward Compatibility
   The pull request introduces backward-incompatible changes by rejecting 
string representations of numbers, ensuring that literals are correctly typed 
according to their original value.
   
   ### BigDecimal Handling:
   A BigDecimal value is used for certain types (e.g., BIG_DECIMAL, TIMESTAMP), 
which helps maintain consistency and precision in numerical operations. The 
BigDecimal representation also avoids issues related to floating-point 
precision.
   
   ### Test Coverage
   Tests have been updated to verify the correct handling of literal types and 
null values. The changes include ensuring that literals like "123" are treated 
as numbers, not strings.
   
   ### Related Issues
   #10380 - Preserve null literal information in literal context and literal 
transform
   
   ### Impact
   Backward Compatibility
   This change may cause issues with older code that relies on the previous 
behavior of accepting string representations for numerical literals.
   
   ### Performance Considerations
   Caching of BigDecimal values is introduced to optimize performance by 
avoiding repeated conversions of numerical values in transformation functions. 
However, this could increase memory usage in certain edge cases, such as large 
queries with numerous literals.
   
   ### Steps to Reproduce
   Pass a numerical literal as a string (e.g., "123").
   Observe that the string literal is no longer treated as a numerical value.


-- 
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-unsubscr...@pinot.apache.org.apache.org

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


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

Reply via email to