Jackie-Jiang commented on code in PR #8769:
URL: https://github.com/apache/pinot/pull/8769#discussion_r881944460
##########
pinot-core/src/main/java/org/apache/pinot/core/query/aggregation/function/MaxAggregationFunction.java:
##########
@@ -92,6 +93,16 @@ public void aggregate(int length, AggregationResultHolder
aggregationResultHolde
aggregationResultHolder.setValue(Math.max(max,
aggregationResultHolder.getDoubleResult()));
break;
}
+ case BIG_DECIMAL: {
+ BigDecimal[] values = blockValSet.getBigDecimalValuesSV();
+ BigDecimal max = values[0];
+ for (int i = 0; i < length & i < values.length; i++) {
+ max = values[i].max(max);
+ }
+ // todo: even though the source data has BIG_DECIMAL type, we still
only support double precision.
Review Comment:
(nit) We usually use capital case `TODO` (for easier searching)
##########
pinot-common/src/main/java/org/apache/pinot/common/function/scalar/DataTypeConversionFunctions.java:
##########
@@ -39,6 +39,12 @@ public class DataTypeConversionFunctions {
private DataTypeConversionFunctions() {
}
+ // SQL Calcite fails to parse 'cast(value, targetType)' as cast is a
reserved SQL keyword.
+ @ScalarFunction
+ public static Object cast2(Object value, String targetTypeLiteral) {
Review Comment:
Let's not add this function. The SQL syntax for cast is `CAST(value AS
targetType)`, e.g. `CAST(colA AS BIG_DECIMAL)`
--
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]