Skip to content

Commit

Permalink
Fix integer overflow in SegmentMetadataQuery numRows. (#2890)
Browse files Browse the repository at this point in the history
  • Loading branch information
gianm authored and xvrl committed Apr 27, 2016
1 parent c29cb7d commit 90ce03c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public SegmentAnalyzer(EnumSet<SegmentMetadataQuery.AnalysisType> analysisTypes)
this.analysisTypes = analysisTypes;
}

public int numRows(Segment segment)
public long numRows(Segment segment)
{
return Preconditions.checkNotNull(segment, "segment").asStorageAdapter().getNumRows();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public Sequence<SegmentAnalysis> run(Query<SegmentAnalysis> inQ, Map<String, Obj
SegmentMetadataQuery query = (SegmentMetadataQuery) inQ;
final SegmentAnalyzer analyzer = new SegmentAnalyzer(query.getAnalysisTypes());
final Map<String, ColumnAnalysis> analyzedColumns = analyzer.analyze(segment);
final int numRows = analyzer.numRows(segment);
final long numRows = analyzer.numRows(segment);
long totalSize = 0;

if (analyzer.analyzingSize()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class SegmentAnalysis implements Comparable<SegmentAnalysis>
private final List<Interval> interval;
private final Map<String, ColumnAnalysis> columns;
private final long size;
private final int numRows;
private final long numRows;
private final Map<String, AggregatorFactory> aggregators;

@JsonCreator
Expand All @@ -43,7 +43,7 @@ public SegmentAnalysis(
@JsonProperty("intervals") List<Interval> interval,
@JsonProperty("columns") Map<String, ColumnAnalysis> columns,
@JsonProperty("size") long size,
@JsonProperty("numRows") int numRows,
@JsonProperty("numRows") long numRows,
@JsonProperty("aggregators") Map<String, AggregatorFactory> aggregators
)
{
Expand Down Expand Up @@ -80,7 +80,7 @@ public long getSize()
}

@JsonProperty
public int getNumRows()
public long getNumRows()
{
return numRows;
}
Expand Down

0 comments on commit 90ce03c

Please sign in to comment.