pier-oliviert opened a new pull request, #3002:
URL: https://github.com/apache/arrow-rs/pull/3002

   # Which issue does this PR close?
   There's no issue currently, because I just had this issue this morning and 
decided to make a PR for it. I can open up an issue if it helps.
   
   <!--
   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.
   -->
   
   # Rationale for this change
   
   This is so that it's possible to gather information from the column we're 
about to write to. That information was already present in the column but 
buried inside the internal of the Writer.
   
   Because the ColumnDescPtr is an Arc, it is not expensive to clone the arc 
and make it publicly available to the column writer.
   
   ```rust
   while let Ok(Some(mut col)) = writer.next_column() {
       let descriptor = col.descriptor();
       let name = descriptor.name();
   }
   ```
   
   Without this patch, it's required to implement a sort of book keeping by the 
caller to make sure the data we're about to write to matches the column we have.
   
   With the patch, it removes the need to guess which column the code refers to.
   
   <!--
   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?
   The PR is missing tests, I wasn't sure if the test would add any 
value/safety. I'm more than happy to provide some tests if you think it's 
important.
   
   <!--
   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?
   None, I believe.
   
   <!--
   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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to