You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@orc.apache.org by GitBox <gi...@apache.org> on 2021/09/29 12:55:13 UTC

[GitHub] [orc] stiga-huang opened a new pull request #921: ORC-1012: Support specifying columns in orc-scan

stiga-huang opened a new pull request #921:
URL: https://github.com/apache/orc/pull/921


   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. File a JIRA issue first and use it as a prefix of your PR title, e.g., `ORC-001: Fix ABC`.
     2. Use your PR title to summarize what this PR proposes instead of describing the problem.
     3. Make PR title and description complete because these will be the permanent commit log.
     4. If possible, provide a concise and reproducible example to reproduce the issue for a faster review.
     5. If the PR is unfinished, use GitHub PR Draft feature.
   -->
   
   ### What changes were proposed in this pull request?
   <!--
   Please clarify what changes you are proposing. The purpose of this section is to outline the changes and how this PR fixes the issue. 
   If possible, please consider writing useful notes for better and faster reviews in your PR. See the examples below.
     1. If you refactor some codes with changing classes, showing the class hierarchy will help reviewers.
     2. If there is a discussion in the mailing list, please add the link.
   -->
   The PR adds an option to support specifying columns to be read in the orc-scan tool.
   
   ### Why are the changes needed?
   <!--
   Please clarify why the changes are needed. For instance,
     1. If you propose a new API, clarify the use case for a new API.
     2. If you fix a bug, you can clarify why it is a bug.
   -->
   Currently the orc-scan tool will scan all columns. I find it useful to specifying columns when profiling read performance on specified data types.
   
   ### How was this patch tested?
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   -->
   Manually tested with the new option.
   Added tests in tools/test/TestFileScan.cc.


-- 
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: dev-unsubscribe@orc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [orc] dongjoon-hyun commented on pull request #921: ORC-1012: Support specifying columns in orc-scan

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on pull request #921:
URL: https://github.com/apache/orc/pull/921#issuecomment-995309603


   Since this is `tools`-only change, I backported this to branch-1.7.


-- 
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: dev-unsubscribe@orc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [orc] wgtmac commented on pull request #921: ORC-1012: Support specifying columns in orc-scan

Posted by GitBox <gi...@apache.org>.
wgtmac commented on pull request #921:
URL: https://github.com/apache/orc/pull/921#issuecomment-931023274


   > Currently the other tools (orc-contents and orc-memory) that support specifying columns use fieldId instead of columnId. So only top-level field ids are supported. The new option in orc-scan has the same meaning as these tools. I'd suggest adding another option, e.g. --columnIds=1,2,3, for specifying columnIds. Maybe in a separate PR. Do you think it's ok?
   > 
   > BTW, I slightly modify the test to include a top-level STRUCT column (fieldId=9 in examples/TestOrcFile.testSeek.orc).
   
   I am OK with the current PR (i.e. column selection by the field ids). The orc-scan tool is usually used to verify the integrity of an ORC file. We can add more complex column selection option to it later.


-- 
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: dev-unsubscribe@orc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [orc] dongjoon-hyun merged pull request #921: ORC-1012: Support specifying columns in orc-scan

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun merged pull request #921:
URL: https://github.com/apache/orc/pull/921


   


-- 
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: dev-unsubscribe@orc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [orc] wgtmac commented on pull request #921: ORC-1012: Support specifying columns in orc-scan

Posted by GitBox <gi...@apache.org>.
wgtmac commented on pull request #921:
URL: https://github.com/apache/orc/pull/921#issuecomment-930704093


   > It's great. Thank you, @stiga-huang . BTW, do we support only ordinal column numbers?
   > 
   > Could you give explain how to select columns from complex types like nested columns like `struct`? It would be great if we can have a test coverage for complex types, too.
   > 
   > cc @wgtmac
   
   The RowReaderOptions support column pruning by fieldName (include(list<string>)), fieldId (include(list<int>)), and columnId (includeTypes(list<int>)). The last one supports pruning nested column in the struct. I think that is what @dongjoon-hyun has mentioned. Support nested pruning requires user to specify the exact columnId which is not easy if the schema is rather complex.


-- 
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: dev-unsubscribe@orc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [orc] stiga-huang commented on pull request #921: ORC-1012: Support specifying columns in orc-scan

Posted by GitBox <gi...@apache.org>.
stiga-huang commented on pull request #921:
URL: https://github.com/apache/orc/pull/921#issuecomment-930796037


   Currently the other tools (orc-contents and orc-memory) that support specifying columns use fieldId instead of columnId. So only top-level field ids are supported. The new option in orc-scan has the same meaning as these tools. I'd suggest adding another option, e.g. --columnIds=1,2,3, for specifying columnIds. Maybe in a separate PR. Do you think it's ok?
   
   BTW, I slightly modify the test to include a top-level STRUCT column (fieldId=9 in examples/TestOrcFile.testSeek.orc).


-- 
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: dev-unsubscribe@orc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org