Jackie-Jiang commented on a change in pull request #5476: URL: https://github.com/apache/incubator-pinot/pull/5476#discussion_r437753947
########## File path: pinot-core/src/main/java/org/apache/pinot/core/startree/v2/builder/BaseSingleTreeBuilder.java ########## @@ -150,7 +151,11 @@ // Ignore the column for COUNT aggregation function if (_valueAggregators[index].getAggregationType() != AggregationFunctionType.COUNT) { String column = functionColumnPair.getColumn(); - _metricDataTypes[index] = schema.getFieldSpecFor(column).getDataType(); + FieldSpec fieldSpec = schema.getFieldSpecFor(column); + if (fieldSpec == null) { Review comment: I would suggest using checkState instead: ```suggestion Preconditions.checkState(fieldSpec != null, "Column: '%s' does not exist in the schema", column); ``` ---------------------------------------------------------------- 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. 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