Jackie-Jiang commented on code in PR #16552:
URL: https://github.com/apache/pinot/pull/16552#discussion_r2263813158


##########
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/utils/TableConfigUtils.java:
##########
@@ -510,6 +512,18 @@ public static void validateIngestionConfig(TableConfig 
tableConfig, Schema schem
           Preconditions.checkState(firstArgument.getType() == 
ExpressionContext.Type.IDENTIFIER,
               "First argument of aggregation function: %s must be identifier, 
got: %s", functionType,
               firstArgument.getType());
+          // Create a ValueAggregator for the aggregation function and check 
if it is supported for ingestion (fixed
+          // size aggregated value).
+          ValueAggregator<?, ?> valueAggregator;
+          try {
+            valueAggregator =
+                ValueAggregatorFactory.getValueAggregator(functionType, 
arguments.subList(1, numArguments));
+          } catch (Exception e) {
+            throw new IllegalStateException(
+                "Caught exception while creating ValueAggregator for 
aggregation function: " + aggregationFunction, e);
+          }
+          
Preconditions.checkState(valueAggregator.isAggregatedValueFixedSize(),
+              "Aggregation function: %s must have fixed size aggregated 
value", aggregationFunction);

Review Comment:
   For ingestion aggregation, the same value is updated in-place, so we cannot 
handle size change



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