Github user babokim commented on a diff in the pull request:
https://github.com/apache/tajo/pull/138#discussion_r17666749
--- Diff:
tajo-core/src/main/java/org/apache/tajo/engine/planner/PlannerUtil.java ---
@@ -762,4 +785,43 @@ public static String buildExplainString(LogicalNode
node) {
return explains.toString();
}
+
+ public static FragmentProto[] getNonZeroLengthDataFiles(TajoConf
tajoConf, TableDesc tableDesc,
+ int page, int
pageSize) throws IOException {
+ Path tablePath = tableDesc.getPath();
+ FileSystem fs = tablePath.getFileSystem(tajoConf);
+
+ List<FileStatus> nonZeroLengthFiles = new ArrayList<FileStatus>();
+ if (fs.exists(tablePath)) {
+ getNonZeroLengthDataFiles(fs, tablePath, nonZeroLengthFiles, page,
pageSize);
+ }
+
+ List<FileFragment> fragments = new ArrayList<FileFragment>();
+ for (FileStatus eachFile: nonZeroLengthFiles) {
+ FileFragment fileFragment = new FileFragment(tableDesc.getName(),
eachFile.getPath(), 0, eachFile.getLen(), null);
+ fragments.add(fileFragment);
+ }
+ return FragmentConvertor.toFragmentProtoArray(fragments.toArray(new
FileFragment[]{}));
+ }
+
+ private static void getNonZeroLengthDataFiles(FileSystem fs, Path path,
List<FileStatus> result,
--- End diff --
I will add a comment.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---