Search in sources :

Example 1 with TableStatistics

use of org.apache.drill.exec.planner.common.DrillStatsTable.TableStatistics in project drill by apache.

the class ParquetFormatPlugin method readStatistics.

@Override
public TableStatistics readStatistics(FileSystem fs, Path statsTablePath) throws IOException {
    Stopwatch timer = Stopwatch.createStarted();
    ObjectMapper mapper = DrillStatsTable.getMapper();
    mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
    FSDataInputStream is = fs.open(statsTablePath);
    TableStatistics statistics = mapper.readValue((InputStream) is, TableStatistics.class);
    logger.info("Took {} ms to read statistics from {} format plugin", timer.elapsed(TimeUnit.MILLISECONDS), name);
    timer.stop();
    return statistics;
}
Also used : Stopwatch(org.apache.drill.shaded.guava.com.google.common.base.Stopwatch) FSDataInputStream(org.apache.hadoop.fs.FSDataInputStream) TableStatistics(org.apache.drill.exec.planner.common.DrillStatsTable.TableStatistics) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Aggregations

ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 TableStatistics (org.apache.drill.exec.planner.common.DrillStatsTable.TableStatistics)1 Stopwatch (org.apache.drill.shaded.guava.com.google.common.base.Stopwatch)1 FSDataInputStream (org.apache.hadoop.fs.FSDataInputStream)1