Skip to content
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

ARROW-5385: [Go] Implement EXTENSION datatype #10203

Closed
wants to merge 13 commits into from

Conversation

zeroshade
Copy link
Member

Getting the extension metadata recognized for the integration tests with extension types also had the side effect of being a solution for the custom metadata integration tests, so i've also enabled those for Go.

@zeroshade
Copy link
Member Author

Tagging @emkornfield @sbinet for visibility and reviews.

@github-actions
Copy link

@zeroshade
Copy link
Member Author

The integration test seems to be failing on some rust build failure that is unrelated to this change

@jorgecarleitao
Copy link
Member

Yap, sorry about that. We fixed it in Rust's end; if you re-trigger it should run.

@zeroshade
Copy link
Member Author

@jorgecarleitao The tests are still failing on rust build failures :( Any ideas?

@zeroshade
Copy link
Member Author

@emkornfield @jorgecarleitao bump

@emkornfield
Copy link
Contributor

Sorry will try to take a look my availability this week might be fairly limited.

@zeroshade
Copy link
Member Author

Well that was annoying to track down but I finally fixed the failures. oy.

@emkornfield this is finally ready for review again when you have the time to do so.


// NewExtensionArrayWithStorage constructs a new ExtensionArray from the provided
// ExtensionType and uses the provided storage interface as the underlying storage.
// This will not release the storage array passed in so consumers should call Release
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so users will generally call release right after construction?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If they use this constructor to pass an already existing array.Interface then they still need to manually call Release on the storage array.Interface they pass in since this doesn't take ownership but instead effectively uses Retain to be another reference to the same data.

return false
case !TypeEqual(leftField.Type, rightField.Type, opts...):
case !reflect.DeepEqual(l.index, r.index):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the scope of reflect.DeepEqual, i'm wondering if there are chances transient data might cause false negatives.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it recursively goes through the objects to confirm that they are equal or not. if you look up at the deleted line 64 above this, I actually didn't change this logic at all despite what the diff shows. The diff isn't handling the changed order of the code well, but the previous code was already doing !reflect.DeepEqual(l.index, r.index) so there would be no change in logic from the existing setup for struct types here.

@@ -27,7 +27,7 @@ func TestTypeEqual(t *testing.T) {
checkMetadata bool
}{
{
nil, nil, false, false,
nil, nil, true, false,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in order for simplifying the type comparison code when handling lists / extension types I made a slight change to the logic here so that if you call TypeEqual with both arguments being nil then it returns true that they are equal. I was actually surprised when i found that this wasn't the case already such that TypeEqual(nil, nil) previously returned false. Since it simplified the code in other areas and also makes sense for nil to be equal to nil for a call to TypeEqual I didn't see an issue with making that change which only affected this one unit test which expected the false for two nils.

@emkornfield
Copy link
Contributor

+1 thank you.

michalursa pushed a commit to michalursa/arrow that referenced this pull request Jun 13, 2021
Getting the extension metadata recognized for the integration tests with extension types also had the side effect of being a solution for the custom metadata integration tests, so i've also enabled those for Go.

Closes apache#10203 from zeroshade/extension-type

Authored-by: Matthew Topol <mtopol@factset.com>
Signed-off-by: Micah Kornfield <emkornfield@gmail.com>
@zeroshade zeroshade deleted the extension-type branch September 12, 2021 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants