-
Notifications
You must be signed in to change notification settings - Fork 4k
GH-35828: [Go] Add array.WithUnorderedMapKeys option for array.ApproxEqual
#35823
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
Conversation
|
Thanks for opening a pull request! If this is not a minor PR. Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project. Then could you also rename the pull request title in the following format? or In the case of PARQUET issues on JIRA the title also supports: See also: |
array.ApproxEqual allows map entries with different key orderarray.ApproxEqual allows map entries with different key order
|
@zeroshade it seems there's still a flaky test in FlightSQL |
|
@candiduslynx yea, I'm aware. I've been periodically trying to track down the cause of the flakiness but haven't yet been able to do so. I'll kick the tires and re-run it, it should go away. Hopefully I (or someone) is able to track down the cause soon. It's quite annoying. In the meantime, I'll take a look at this in a bit. Thanks! |
|
Can we create an issue for this one? It doesn't feel it matches the requirements for a |
array.ApproxEqual allows map entries with different key orderarray.ApproxEqual allows map entries with different key order
|
@zeroshade I've opened #35828 |
|
|
Thank you! |
array.ApproxEqual allows map entries with different key orderarray.WithUnorderedMapKeys option for array.ApproxEqual
|
@zeroshade I've moved the control over the new behavior into an option, so the users will not have any breaking changes. |
|
@zeroshade is there a chance to get it merged sooner? It's a blocker for cloudquery/cloudquery#11078 |
zeroshade
left a comment
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.
looks good in general to me, just one question about the WithUnorderedMapKeys vs just checking the KeysSorted member of the MapType and deciding to go with the Unordered check if KeysSorted is false.
@zeroshade I've looked at the I believe updating the code to use |
zeroshade
left a comment
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.
@candiduslynx that sounds good to me and works fine.
Blocked by apache/arrow#35823 Required by cloudquery/cloudquery#11078
|
Benchmark runs are scheduled for baseline = fee8bf9 and contender = d9c2d59. d9c2d59 is a master commit associated with this PR. Results will be available as each benchmark for each run completes. |
…11078) Extracted from #11043 Depends on: * cloudquery/plugin-sdk#913 * apache/arrow#35823 * cloudquery/plugin-sdk#921
Rationale for this change
If we store the value of the
*array.Mapinto Go map we can't expect to put the values back in the same order, as the map traversal order in Go is undefined.This PR extends
array.ApproxEqualby allowing map keys to be in different order.What changes are included in this PR?
New helper functions:
array.arrayApproxEqualMapthat is now used instead ofarray.arrayApproxEqualListfor map comparisonarray.arrayApproxEqualSingleMapEntrythat checks if the single map entry we have matches to the other one without having keys sorted the same wayAre these changes tested?
array.TestArrayApproxEqualMapsgithub.com/cloudquery/plugin-sdk/v3tov3.8.1cloudquery/cloudquery#11078Are there any user-facing changes?
New
array.WithUnorderedMapKeysoption forarray.ApproxEqualthat allows users to control if the entries order is important or not.array.ApproxEqualshould allow map entries be presented in any order #35828