pauladams12345 opened a new issue, #15255:
URL: https://github.com/apache/pinot/issues/15255
## Description
When executing a query which uses the `roundDecimal` function, the query
will fail if the column being rounded is a FLOAT data type and any value for
that column is null.
The `roundDecimal` function works as expected if operating on a DOUBLE
column. The function also works correctly for FLOAT columns if all values
queried are non-null.
## Example
#### Schema
```
{
"schemaName": "example_table",
"enableColumnBasedNullHandling": true,
"dimensionFieldSpecs": [
{
"name": "field",
"dataType": "FLOAT",
"notNull": false
},
...
```
#### Table Contents
| field | timestamp |
|--|--|
| 1.43 | 1741801200 |
| null | 1741801300 |
#### Query
```
SET enableNullHandling=TRUE;
SELECT roundDecimal(field, 1) FROM example_table
```
#### Expected behavior
Returns: `[1.4, null]`
#### Observed behavior:
```
Error Code: 200
QueryExecutionError:
java.lang.RuntimeException: Caught exception while doing operator: class
org.apache.pinot.core.operator.AcquireReleaseColumnsSegmentOperator on segment:
example_table__6__156__20250121T1349Z
at
org.apache.pinot.core.operator.combine.BaseCombineOperator.wrapOperatorException(BaseCombineOperator.java:197)
at
org.apache.pinot.core.operator.combine.BaseSingleBlockCombineOperator.processSegments(BaseSingleBlockCombineOperator.java:96)
at
org.apache.pinot.core.operator.combine.BaseCombineOperator$1.runJob(BaseCombineOperator.java:118)
at
org.apache.pinot.core.util.trace.TraceRunnable.run(TraceRunnable.java:40)
...
Caused by: java.lang.NumberFormatException: Character I is neither a decimal
digit number, decimal point, nor "e" notation exponential mark.
at java.base/java.math.BigDecimal.<init>(BigDecimal.java:608)
at java.base/java.math.BigDecimal.<init>(BigDecimal.java:497)
at java.base/java.math.BigDecimal.<init>(BigDecimal.java:903)
at java.base/java.math.BigDecimal.valueOf(BigDecimal.java:1371)
```
## Workarounds
Coalesce null values to null:
```
SET enableNullHandling=TRUE;
SELECT roundDecimal(COALESCE(field, null), 1) FROM example_table
```
Filter out null values (not applicable to all use cases):
```
SET enableNullHandling=TRUE;
SELECT roundDecimal(field, 1) FROM example_table WHERE field IS NOT NULL
```
## Affected versions
This bug exists in Pinot v1.3.0
--
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]