-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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-36696: [Go] Improve the MapOf and ListOf helpers #36697
Conversation
|
* Removed references to panics I can't find * Updated error messages for list and map to be clearer with validation errors * Added a ListOfWithName to provide a clearer matching method to MapOf which takes a name
dab43fc
to
bf8efbb
Compare
go/parquet/schema/helpers.go
Outdated
return nil, xerrors.Errorf("parquet: listof repetition must not be repeated, got :%s", rep) | ||
} | ||
|
||
if rep == parquet.Repetitions.Repeated || element.RepetitionType() == parquet.Repetitions.Repeated { |
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.
rep == parquet.Repetitions.Repeated
is redundant here as it is already checked above this.
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.
remove redundant check.
Is it possible for one of these to call the other to reduce duplicate code between them?
@zeroshade sorry for the duplication, I really should have picked this up. Also sorted out the checks to actually do what I intended, which was make the error messages clearer and more specific to the check performed. |
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.
LGTM
After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit 15ee521. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. |
### Rationale for this change The aim is to improve the MapOf and ListOf helper functions without breaking anything. I have added a `ListOfWithName` which matches the `MapOf` function in that it takes a name, rather than deriving it from the elements name, which should actually be `element`. This just seems clearer to me as an interface, and makes construction a bit more obvious. ### What changes are included in this PR? * Removed references to panics I can't find * Updated error messages for list and map to be clearer with validation errors * Added a ListOfWithName to provide a clearer matching method to MapOf which takes a name Closes apache#36696 ### Are these changes tested? Yes, I added a test for the new `ListOfWithName` function. ### Are there any user-facing changes? * Closes: apache#36696 Authored-by: Mark Wolfe <[email protected]> Signed-off-by: Matt Topol <[email protected]>
### Rationale for this change The aim is to improve the MapOf and ListOf helper functions without breaking anything. I have added a `ListOfWithName` which matches the `MapOf` function in that it takes a name, rather than deriving it from the elements name, which should actually be `element`. This just seems clearer to me as an interface, and makes construction a bit more obvious. ### What changes are included in this PR? * Removed references to panics I can't find * Updated error messages for list and map to be clearer with validation errors * Added a ListOfWithName to provide a clearer matching method to MapOf which takes a name Closes apache#36696 ### Are these changes tested? Yes, I added a test for the new `ListOfWithName` function. ### Are there any user-facing changes? * Closes: apache#36696 Authored-by: Mark Wolfe <[email protected]> Signed-off-by: Matt Topol <[email protected]>
Rationale for this change
The aim is to improve the MapOf and ListOf helper functions without breaking anything. I have added a
ListOfWithName
which matches theMapOf
function in that it takes a name, rather than deriving it from the elements name, which should actually beelement
.This just seems clearer to me as an interface, and makes construction a bit more obvious.
What changes are included in this PR?
Closes #36696
Are these changes tested?
Yes, I added a test for the new
ListOfWithName
function.Are there any user-facing changes?