Skip to content

Commit

Permalink
Merge pull request apache#747 from metamx/ingest-segment-npe-fix
Browse files Browse the repository at this point in the history
fix NPE
  • Loading branch information
fjy committed Sep 17, 2014
2 parents a17794a + e6d93a3 commit a4777ed
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,18 @@ public Sequence<InputRow> apply(final Cursor cursor)
final Map<String, DimensionSelector> dimSelectors = Maps.newHashMap();
for (String dim : dims) {
final DimensionSelector dimSelector = cursor.makeDimensionSelector(dim);
dimSelectors.put(dim, dimSelector);
// dimSelector is null if the dimension is not present
if (dimSelector != null) {
dimSelectors.put(dim, dimSelector);
}
}

final Map<String, ObjectColumnSelector> metSelectors = Maps.newHashMap();
for (String metric : metrics) {
final ObjectColumnSelector metricSelector = cursor.makeObjectColumnSelector(metric);
metSelectors.put(metric, metricSelector);
if (metricSelector != null) {
metSelectors.put(metric, metricSelector);
}
}

return Sequences.simple(
Expand Down

0 comments on commit a4777ed

Please sign in to comment.