Skip to content

feat: add append_key_value_metadata#3367

Merged
tustvold merged 7 commits into
apache:masterfrom
jiacai2050:master
Dec 20, 2022
Merged

feat: add append_key_value_metadata#3367
tustvold merged 7 commits into
apache:masterfrom
jiacai2050:master

Conversation

@jiacai2050

@jiacai2050 jiacai2050 commented Dec 19, 2022

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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

@jiacai2050

Copy link
Copy Markdown
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

@tustvold tustvold left a comment

Copy link
Copy Markdown
Contributor

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 thread parquet/src/file/writer.rs Outdated
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
Copy Markdown
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?

Comment thread parquet/src/arrow/arrow_writer/mod.rs Outdated
jiacai2050 and others added 2 commits December 20, 2022 18:28
Co-authored-by: Raphael Taylor-Davies <1781103+tustvold@users.noreply.github.com>
Comment thread parquet/src/file/writer.rs Outdated
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
Copy Markdown
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
Copy Markdown
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

ursabot commented Dec 20, 2022

Copy link
Copy Markdown

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