Skip to content

ARROW-483: [C++/Python] Provide access to "custom_metadata" Field attribute in IPC setting - #588

Closed
cpcloud wants to merge 1 commit into
apache:masterfrom
cpcloud:ARROW-483
Closed

cpcloud wants to merge 1 commit into
apache:masterfrom
cpcloud:ARROW-483

Conversation

@cpcloud

@cpcloud cpcloud commented Apr 23, 2017

Copy link
Copy Markdown
Contributor

No description provided.

@cpcloud

cpcloud commented Apr 24, 2017

Copy link
Copy Markdown
Contributor Author

Looks like the integration tests are failing. Looking into it now.

@wesm wesm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Aside from the nitpicky points about copying / ownership in the schema, this looks good.

Comment thread cpp/src/arrow/ipc/metadata.cc Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

NB. auto here will invoke the string copy constructor. You have to use const auto&

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changed to const auto&

Comment thread cpp/src/arrow/ipc/metadata.cc Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

per below, this calls the copy constructor. One way to prevent this is to make KeyValueMetadata non-copyable. If you did that, you would need to pass around something like std::unique_ptr<const KeyValueMetadata>. Not sure this is a big deal right now

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I changed this to use const auto&

Comment thread cpp/src/arrow/ipc/metadata.cc Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just auto is ok for const T*

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changed to auto.

Comment thread cpp/src/arrow/type.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this suggests we might want to make the API

Schema(..., std::unique_ptr<KeyValueMetadata> custom_metadata) and
Schema(..., std::unique_ptr<const KeyValueMetadata> custom_metadata) and

with the storage in this class as std::unique_ptr<const KeyValueMetadata>. I think you can move std::unique_ptr<T> into std::unique_ptr<const T>

We could further make KeyValueMetadata non-copyable. Still custom_metadata() returns const KeyValueMetadata&. We could do this in a follow up patch

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hm, this seems like a lot of additional complexity relative to what the purpose of this class is. What do we get from using unique_ptr?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you make this one and the one above int64_t?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Comment thread cpp/src/arrow/util/key_value_metadata.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is this ctor used?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Nope, removed.

Comment thread cpp/src/arrow/util/logging.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

which clang-format version did this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I upgraded to 4.0 recently. I'll look into keeping my older version or making sure that I run the 3.9 fixes if possible.

@cpcloud

cpcloud commented Apr 25, 2017

Copy link
Copy Markdown
Contributor Author

@wesm is this good to merge?

@wesm wesm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

+1. Thanks @cpcloud! I will look at the copying thing in a separate patch

@wesm

wesm commented Apr 25, 2017

Copy link
Copy Markdown
Member

@julienledem note that this makes a minor change in the Flatbuffers to use string instead of [ubyte] for the value in the KeyValue -- these have the same representation (a byte sequence), but [ubyte] is more cumbersome to work with in C++ (and maybe in Java, too).

@asfgit asfgit closed this in 7d433dc Apr 25, 2017
@cpcloud
cpcloud deleted the ARROW-483 branch April 25, 2017 22:00
jeffknupp pushed a commit to jeffknupp/arrow that referenced this pull request Jun 3, 2017
…ribute in IPC setting

Author: Phillip Cloud <cpcloud@gmail.com>

Closes apache#588 from cpcloud/ARROW-483 and squashes the following commits:

f671ba4 [Phillip Cloud] ARROW-483: [C++/Python] Provide access to "custom_metadata" Field attribute in IPC setting
pribor pushed a commit to GlobalWebIndex/arrow that referenced this pull request Oct 24, 2025
…e_rc.sh` (apache#589)

Fixes apacheGH-588.

`release.yml` takes at least 30min now. So 60s wait interval is too
short. We can use longer interval to avoid needless API requests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants