You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2020/06/09 22:19:23 UTC

[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #5476: Improve error message on NPE related to typo in star schema column names

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:
users@infra.apache.org



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