ayushtkn commented on a change in pull request #3037:
URL: https://github.com/apache/hive/pull/3037#discussion_r812427536
##########
File path: ql/src/java/org/apache/hadoop/hive/ql/stats/BasicStatsNoJobTask.java
##########
@@ -446,4 +473,86 @@ private void shutdownAndAwaitTermination(ExecutorService
threadPool) {
@Override
public void setDpPartSpecs(Collection<Partition> dpPartSpecs) {
}
+
+ /**
+ * Utility class to process file level stats in parallel.
+ */
+ private static class FileStatProcessor implements Callable <FileStats> {
+
+ private final InputSplit dummySplit;
+ private final InputFormat<?, ?> inputFormat;
+ private final JobConf jc;
+ private final FileStatus file;
+
+ FileStatProcessor(FileStatus file, InputFormat<?, ?> inputFormat,
InputSplit dummySplit, JobConf jc) {
+ this.file = file;
+ this.dummySplit = dummySplit;
+ this.inputFormat = inputFormat;
+ this.jc = jc;
+ }
+
+ @Override
+ public FileStats call() throws Exception {
+ try (org.apache.hadoop.mapred.RecordReader<?, ?> recordReader =
inputFormat
+ .getRecordReader(dummySplit, jc, Reporter.NULL)) {
+ if (recordReader instanceof StatsProvidingRecordReader) {
+ StatsProvidingRecordReader statsRR;
+ statsRR = (StatsProvidingRecordReader) recordReader;
+ FileStats fileStats = new FileStats();
+ fileStats.setRawDataSize(statsRR.getStats().getRawDataSize());
Review comment:
done along with others
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]