-
Notifications
You must be signed in to change notification settings - Fork 232
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
Set OrcConf.INCLUDE_COLUMNS for ORC reading #4933
Merged
sperlingxx
merged 6 commits into
NVIDIA:branch-22.04
from
sperlingxx:add_orc_conf_include_column
Mar 19, 2022
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8ff19fd
set_INCLUDE_COLUMNS_for_ORC_reading
sperlingxx 61a4f4a
Merge remote-tracking branch 'origin/branch-22.04' into add_orc_conf_…
sperlingxx 315c99c
update
sperlingxx f819fcf
Revert "update"
sperlingxx 2ec24c4
revert
sperlingxx 22ae09d
update
sperlingxx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious why this is conditional on
!canPruneCols
? The equivalent Spark code setting this is not similarly conditional. We're callingbuildOrcReader
in either case which will examine theINCLUDE_COLUMNS
setting, so it seems prudent to set it whether or not we can prune, minimally to help keep this code in sync with the Spark version.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jlowe, following your question, I found that we should add this conf on the opposite conditional branch, which canPruneCols is TRUE. Because canPruneCols represents whether trusts ORC to prune columns or do it by ourselves.
@wbo4958 please correct me if I am wrong. Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also simplified the
requestedColumnIds
method.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this change. The code was intentionally trying to be similar to the Apache Spark version. The same is true for the code calling this function.
IMO we need to do what Spark is doing with respect to when and how it sets up
INCLUDE_COLUMNS
. Looking at the Spark code, it is always settingINCLUDE_COLUMNS
as long asrequestedColPruneInfo
is non-empty. We should do the same.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jlowe, I reverted it. But I found a bigger problem. It seems that the setting of
OrcConf.INCLUDE_COLUMNS
is NOT compatible with the schema pruning applied incheckSchemaCompatibility
, which leads to the failure when constructingSchemaEvolution
: https://github.com/NVIDIA/spark-rapids/blob/branch-22.04/sql-plugin/src/main/scala/com/nvidia/spark/rapids/GpuOrcScanBase.scala#L951.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checkSchemaCompatibility
also is derived from Apache Spark, so does it's version too have issues with INCLUDE_COLUMNS when pruning is applied?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jlowe I failed to find
checkSchemaCompatibility
or similiar things in Apache Spark. Alternatively, I made some change on thecheckSchemaCompatibility
. Let it prune include status array by the field ID of pruned fields from read schema, which takes place simultaneously with the prune of read schema.