Github user sansanichfb commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/1209#discussion_r109271678
  
    --- 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 --
    
    Good idea, updated.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to