-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
GH-42245: [Swift] Ensure map behavior is the same for all key types #42246
Conversation
let array: AnyArray = try self.getCol(self.singleRBCol) | ||
return array.asAny(self.rbIndex) as! T // swiftlint:disable:this force_cast |
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.
Can we call doDecode<T>(_ col: Int)
instead of adding a similar code?
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.
Will do. My goal was to make it clear that the index for the single column was being handled a bit different but sending in the singleRBCol to the doDecode method works.
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.
Ah, defining doDecodeSingleValue()
and isNullSingleValue()
is OK. I just wanted to say that changing the implementation something like:
func doDecodeSingleValue<T>() throws -> T? {
return doDecode(self.singleRBCol)
}
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.
Aha, I see! Thanks for clarifying! We do remove the overhead of another func call by removing the SingleValue methods. Let me know what you think.
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.
If there is a performance overhead, I'm OK with the current approach.
let array: AnyArray = try self.getCol(self.singleRBCol) | ||
return array.asAny(self.rbIndex) == nil |
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.
Can we call isNull(_ col: Int)
instead?
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.
+1
After merging your PR, Conbench analyzed the 7 benchmarking runs that have been run so far on merge-commit d28078d. There were 12 benchmark results with an error:
There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 9 possible false positives for unstable benchmarks that are known to sometimes produce them. |
Rationale for this change
Behavior of decoding a map currently changes based on the key type (String or not String)
What changes are included in this PR?
Added method for handling map to ensure that all maps are decoded the same way.
Are these changes tested?
Yes