Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return empty dataframe when reading an ORC file using empty columns option #11446

Merged

Conversation

vuule
Copy link
Contributor

@vuule vuule commented Aug 3, 2022

Description

Changes are mostly equivalent to Parquet changes in #11018.

Store the columns option as optional:

  • nullopt when columns are not passed by caller - read all columns.
  • Empty vector when caller explicitly passes an empty list/vector - return empty dataframe.
  • Vector of column names - read columns with given names.

Also includes a small cleanup of the code equivalent in the Parquet reader.

Fixes #11021

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@vuule vuule added bug Something isn't working cuIO cuIO issue breaking Breaking change labels Aug 3, 2022
@vuule vuule self-assigned this Aug 3, 2022
@github-actions github-actions bot added Java Affects Java cuDF API. Python Affects Python cuDF API. libcudf Affects libcudf (C++/CUDA) code. labels Aug 3, 2022
Copy link
Contributor

@galipremsagar galipremsagar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall changes LGTM, we will need the following workaround due to a bug in pandas.

python/cudf/cudf/tests/test_orc.py Outdated Show resolved Hide resolved
Copy link
Contributor

@galipremsagar galipremsagar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to go from cython/python side! Thanks @vuule !!

@codecov
Copy link

codecov bot commented Aug 3, 2022

Codecov Report

❗ No coverage uploaded for pull request base (branch-22.10@e099e01). Click here to learn what that means.
The diff coverage is n/a.

@@               Coverage Diff               @@
##             branch-22.10   #11446   +/-   ##
===============================================
  Coverage                ?   86.47%           
===============================================
  Files                   ?      144           
  Lines                   ?    22856           
  Branches                ?        0           
===============================================
  Hits                    ?    19765           
  Misses                  ?     3091           
  Partials                ?        0           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@vuule vuule marked this pull request as ready for review August 3, 2022 22:03
@vuule vuule requested review from a team as code owners August 3, 2022 22:03
cpp/include/cudf/io/orc.hpp Outdated Show resolved Hide resolved
cpp/include/cudf/io/orc.hpp Outdated Show resolved Hide resolved
cpp/src/io/orc/aggregate_orc_metadata.cpp Show resolved Hide resolved
Co-authored-by: MithunR <mythrocks@gmail.com>
Copy link
Contributor

@mythrocks mythrocks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for the C++ and Java/JNI code.

@vuule vuule requested a review from ttnghia August 3, 2022 22:24
Copy link
Contributor

@ttnghia ttnghia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C++ approval.

@vuule vuule added the 5 - Ready to Merge Testing and reviews complete, ready to merge label Aug 3, 2022
@vuule
Copy link
Contributor Author

vuule commented Aug 4, 2022

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 9429099 into rapidsai:branch-22.10 Aug 4, 2022
@vuule vuule deleted the bug-orc-reader-empty-col-names branch August 4, 2022 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge breaking Breaking change bug Something isn't working cuIO cuIO issue Java Affects Java cuDF API. libcudf Affects libcudf (C++/CUDA) code. Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Empty columns is not returning empty dataframe in read_orc
4 participants