You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/12/19 08:15:47 UTC

[GitHub] [arrow-rs] jiacai2050 opened a new pull request, #3367: feat: add update_key_value_metadata

jiacai2050 opened a new pull request, #3367:
URL: https://github.com/apache/arrow-rs/pull/3367

   # Which issue does this PR close?
   
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes #3356.
   
   # Rationale for this change
    
   <!--
   Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
   Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
   -->
   
   # What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   # Are there any user-facing changes?
   
   Yes, add a new method in ArrowWriter: `update_key_value_metadata`
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!---
   If there are any breaking changes to public APIs, please add the `breaking change` label.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] jiacai2050 commented on a diff in pull request #3367: feat: add append_key_value_metadata

Posted by GitBox <gi...@apache.org>.
jiacai2050 commented on code in PR #3367:
URL: https://github.com/apache/arrow-rs/pull/3367#discussion_r1053885767


##########
parquet/src/file/writer.rs:
##########
@@ -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| {

Review Comment:
   👍 Good catch 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3367: feat: add append_key_value_metadata

Posted by GitBox <gi...@apache.org>.
tustvold commented on code in PR #3367:
URL: https://github.com/apache/arrow-rs/pull/3367#discussion_r1053433927


##########
parquet/src/file/writer.rs:
##########
@@ -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| {

Review Comment:
   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



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold commented on pull request #3367: feat: add update_key_value_metadata

Posted by GitBox <gi...@apache.org>.
tustvold commented on PR #3367:
URL: https://github.com/apache/arrow-rs/pull/3367#issuecomment-1357294337

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] ursabot commented on pull request #3367: feat: add append_key_value_metadata

Posted by GitBox <gi...@apache.org>.
ursabot commented on PR #3367:
URL: https://github.com/apache/arrow-rs/pull/3367#issuecomment-1359786101

   Benchmark runs are scheduled for baseline = 0f196b8dad7592ae139d17c4a8aa960b0e8731fa and contender = f521e11dc2da0313cb1a16958d39a67a41a25fa6. f521e11dc2da0313cb1a16958d39a67a41a25fa6 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ec2-t3-xlarge-us-east-2] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/0e51a3d0c0584a54b64cd9506175a5bc...1df1650c4b4e433c801452f9e001151b/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/54bb64f16ee14e3e874392b45250db2d...ceaf65987d9940bcb880cb69ed4a0401/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/066ca45fdfd3473280d04fd59d3f3b3a...6e76f65fac7f4224bad6a9d0d149549f/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/e2e1d737fa774fba854eb329cb1a4e0d...61c6668a88a049f5b1ee1e8b6acf13dc/)
   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
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] jiacai2050 commented on pull request #3367: feat: add update_key_value_metadata

Posted by GitBox <gi...@apache.org>.
jiacai2050 commented on PR #3367:
URL: https://github.com/apache/arrow-rs/pull/3367#issuecomment-1357319367

   Make sense, will address this soon.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3367: feat: add append_key_value_metadata

Posted by GitBox <gi...@apache.org>.
tustvold commented on code in PR #3367:
URL: https://github.com/apache/arrow-rs/pull/3367#discussion_r1052467082


##########
parquet/src/arrow/arrow_writer/mod.rs:
##########
@@ -158,6 +158,13 @@ impl<W: Write> ArrowWriter<W> {
         self.flush_rows(self.buffered_rows)
     }
 
+    /// Update key value metadata.

Review Comment:
   ```suggestion
       /// Additional [`KeyValue`] metadata to be written in addition to those from [`WriterProperties`]
   ```



##########
parquet/src/file/writer.rs:
##########
@@ -298,7 +301,10 @@ 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(|mut v| {
+                v.extend(self.kv_metadatas.clone());
+                v
+            }),

Review Comment:
   ```suggestion
               key_value_metadata: self.props.key_value_metadata().iter().chain(&self.kv_metadatas).cloned().collect(),
   ```
   Or something, perhaps?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold merged pull request #3367: feat: add append_key_value_metadata

Posted by GitBox <gi...@apache.org>.
tustvold merged PR #3367:
URL: https://github.com/apache/arrow-rs/pull/3367


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org