diff --git a/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java b/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java index ff8c7c5..38d8681 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java @@ -475,7 +475,8 @@ public void run() { if (context.cacheStripeDetails) { fileInfo = verifyCachedFileInfo(file); } - context.schedule(new SplitGenerator(context, fs, file, fileInfo)); + SplitGenerator spgen = new SplitGenerator(context, fs, file, fileInfo); + spgen.schedule(); } } } catch (Throwable th) { @@ -553,6 +554,19 @@ Path getPath() { return file.getPath(); } + void schedule() throws IOException { + if(locations.length == 1 && file.getLen() < context.maxSize) { + String[] hosts = locations[0].getHosts(); + synchronized (context.splits) { + context.splits.add(new OrcSplit(file.getPath(), 0, file.getLen(), + hosts, fileMetaInfo)); + } + } else { + // if it requires a compute task + context.schedule(this); + } + } + @Override public String toString() { return "splitter(" + file.getPath() + ")"; @@ -877,4 +891,4 @@ private Object getMin(ColumnStatistics index) { this.types = types; } } -} \ No newline at end of file +}