-
Notifications
You must be signed in to change notification settings - Fork 917
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
Skip repeated checks on convert function in TColumnGenerator #6786
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6786 +/- ##
======================================
Coverage 0.00% 0.00%
======================================
Files 687 687
Lines 42439 42439
Branches 5793 5793
======================================
Misses 42439 42439 ☔ View full report in Codecov by Sentry. |
val value = if (isConvertFuncDefined) { | ||
convertFunc(row, ordinal) | ||
} else { | ||
getColumnAs[T](row, ordinal) |
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.
let's use a simple way
if (convertFunc == null) {
...
} else {
...
}
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 would still prefer to use an extracted boolean value for this. I assume that accessing a boolean costs less step and byte code steps for comparing convertFunc
to null
, especially since it's repeatedly used and checked once for each row.
…erator # 🔍 Description ## Issue References 🔗 This pull request fixes # ## Describe Your Solution 🔧 - `TColumnGenerator` is used for generating column-based data. This PR skips repeated checks on checking nullability of the convert function in generating single column. ## Types of changes 🔖 - [ ] Bugfix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) ## Test Plan 🧪 #### Behavior Without This Pull Request ⚰️ #### Behavior With This Pull Request 🎉 #### Related Unit Tests --- # Checklist 📝 - [ ] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html) **Be nice. Be informative.** Closes #6786 from bowenliang123/skip-converfunc-check. Closes #6786 f76f686 [Bowen Liang] nit 930dfef [Bowen Liang] fix 9712274 [Bowen Liang] comment 9db16ef [Bowen Liang] nit 977d215 [Bowen Liang] skip repeated checking on convert function Authored-by: Bowen Liang <[email protected]> Signed-off-by: Bowen Liang <[email protected]> (cherry picked from commit c8b8922) Signed-off-by: Bowen Liang <[email protected]>
Thanks, merged to master (1.11.0) and branch-1.10 (1.10.1). |
🔍 Description
Issue References 🔗
This pull request fixes #
Describe Your Solution 🔧
TColumnGenerator
is used for generating column-based data. This PR skips repeated checks on checking nullability of the convert function in generating single column.Types of changes 🔖
Test Plan 🧪
Behavior Without This Pull Request ⚰️
Behavior With This Pull Request 🎉
Related Unit Tests
Checklist 📝
Be nice. Be informative.