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

feat: add append_key_value_metadata #3367

Merged
merged 7 commits into from Dec 20, 2022
Merged

Conversation

jiacai2050
Copy link
Contributor

@jiacai2050 jiacai2050 commented Dec 19, 2022

Which issue does this PR close?

Closes #3356.

Rationale for this change

What changes are included in this PR?

Are there any user-facing changes?

Yes, add a new method in ArrowWriter: append_key_value_metadata

@github-actions github-actions bot added the parquet Changes to the parquet crate label Dec 19, 2022
@tustvold
Copy link
Contributor

Perhaps we could make this append, as opposed to replacing the key value metadata in WriterProperties?

@jiacai2050
Copy link
Contributor Author

Make sense, will address this soon.

@jiacai2050 jiacai2050 changed the title feat: add update_key_value_metadata feat: add append_key_value_metadata Dec 19, 2022
Copy link
Contributor

@tustvold tustvold left a comment

Choose a reason for hiding this comment

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

Just some minor nits, thank you

Comment on lines 304 to 307
key_value_metadata: self.props.key_value_metadata().cloned().map(|mut v| {
v.extend(self.kv_metadatas.clone());
v
}),
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
key_value_metadata: self.props.key_value_metadata().cloned().map(|mut v| {
v.extend(self.kv_metadatas.clone());
v
}),
key_value_metadata: self.props.key_value_metadata().iter().chain(&self.kv_metadatas).cloned().collect(),

Or something, perhaps?

parquet/src/arrow/arrow_writer/mod.rs Outdated Show resolved Hide resolved
jiacai2050 and others added 2 commits December 20, 2022 18:28
Co-authored-by: Raphael Taylor-Davies <1781103+tustvold@users.noreply.github.com>
@@ -298,7 +301,11 @@ impl<W: Write> SerializedFileWriter<W> {
row_groups,
version: self.props.writer_version().as_num(),
schema: types::to_thrift(self.schema.as_ref())?,
key_value_metadata: self.props.key_value_metadata().cloned(),
key_value_metadata: self.props.key_value_metadata().cloned().map(|kv| {
Copy link
Contributor

Choose a reason for hiding this comment

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

This won't work correctly if props.key_value_metadata isn't present... Which also makes me realise this needs a test. I'll bash something out quickly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 Good catch

@tustvold tustvold merged commit f521e11 into apache:master Dec 20, 2022
@ursabot
Copy link

ursabot commented Dec 20, 2022

Benchmark runs are scheduled for baseline = 0f196b8 and contender = f521e11. f521e11 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on ec2-t3-xlarge-us-east-2] ec2-t3-xlarge-us-east-2
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on test-mac-arm] test-mac-arm
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on ursa-i9-9960x] ursa-i9-9960x
[Skipped ⚠️ Benchmarking of arrow-rs-commits is not supported on ursa-thinkcentre-m75q] ursa-thinkcentre-m75q
Buildkite builds:
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parquet Changes to the parquet crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is it possible for ArrowWriter to write key_value_metadata after write all records
3 participants