Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Updates according to rdblue's comments
  • Loading branch information
Gabor Szadovszky committed Feb 22, 2018
commit 9d14090352dcf21f1158727ce42b9cfcd1ad0e7f
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,27 @@ public abstract class Statistics<T extends Comparable<T>> {
/**
* Builder class to build Statistics objects. Used to read the statistics from the Parquet file.
*/
public static class StatisticsBuilder {
public static class Builder {
private final PrimitiveType type;
private byte[] min;
private byte[] max;
private long numNulls = -1;

private StatisticsBuilder(PrimitiveType type) {
private Builder(PrimitiveType type) {
this.type = type;
}

public StatisticsBuilder withMin(byte[] min) {
public Builder withMin(byte[] min) {
this.min = min;
return this;
}

public StatisticsBuilder withMax(byte[] max) {
public Builder withMax(byte[] max) {
this.max = max;
return this;
}

public StatisticsBuilder withNumNulls(long numNulls) {
public Builder withNumNulls(long numNulls) {
this.numNulls = numNulls;
return this;
}
Expand Down Expand Up @@ -154,8 +154,8 @@ public static Statistics<?> createStats(Type type) {
* type of the column
* @return builder to create new statistics object
*/
public static StatisticsBuilder getBuilder(PrimitiveType type) {
return new StatisticsBuilder(type);
public static Builder getBuilder(PrimitiveType type) {
return new Builder(type);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
import org.apache.parquet.hadoop.metadata.ColumnChunkMetaData;
import org.apache.parquet.hadoop.metadata.CompressionCodecName;
import org.apache.parquet.column.EncodingStats;
import org.apache.parquet.column.statistics.Statistics.StatisticsBuilder;
import org.apache.parquet.hadoop.metadata.ParquetMetadata;
import org.apache.parquet.io.ParquetDecodingException;
import org.apache.parquet.schema.ColumnOrder.ColumnOrderName;
Expand Down Expand Up @@ -402,7 +401,8 @@ public static org.apache.parquet.column.statistics.Statistics fromParquetStatist
static org.apache.parquet.column.statistics.Statistics fromParquetStatisticsInternal
(String createdBy, Statistics formatStats, PrimitiveType type, SortOrder typeSortOrder) {
// create stats object based on the column type
StatisticsBuilder statsBuilder = org.apache.parquet.column.statistics.Statistics.getBuilder(type);
org.apache.parquet.column.statistics.Statistics.Builder statsBuilder =
org.apache.parquet.column.statistics.Statistics.getBuilder(type);

if (formatStats != null) {
// Use the new V2 min-max statistics over the former one if it is filled
Expand Down