Github user denalex commented on a diff in the pull request:
https://github.com/apache/incubator-hawq/pull/1209#discussion_r109265306
--- Diff:
pxf/pxf-hive/src/main/java/org/apache/hawq/pxf/plugins/hive/HiveORCAccessor.java
---
@@ -213,4 +237,40 @@ private boolean buildArgument(SearchArgument.Builder
builder, Object filterObj)
return true;
}
+ /**
+ * Fetches file-level statistics from an ORC file.
+ */
+ @Override
+ public void retrieveStats() throws Exception {
+ FragmentMetadata fragmentMetadata =
Utilities.parseFragmentMetadata(inputData);
+ /*
+ * We are using file-level stats therefore if file has multiple
splits,
+ * it's enough to return count for a first split in file.
+ * In case file has multiple splits - we don't want to duplicate
counts.
+ */
+ if (inputData.getFragmentIndex() == 0)
+ this.count = this.orcReader.getNumberOfRows();
+ }
+
+ /**
+ * Emits tuple without reading from disk, currently supports COUNT
+ */
+ @Override
+ public OneRow emitAggObject() {
+ OneRow row = null;
+ switch (inputData.getAggType()) {
+ case COUNT:
+ if (objectsEmitted < count) {
+ objectsEmitted++;
+ row = new OneRow(key, data);
--- End diff --
as this is likely a dummy object, can you reuse a single object and return
it multiple times rather than creating multiple dummy objects ?
---
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.
---