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/08/19 12:57:03 UTC

[GitHub] [arrow-rs] HaoYang670 opened a new issue, #2524: Add the `length` field for `Buffer`

HaoYang670 opened a new issue, #2524:
URL: https://github.com/apache/arrow-rs/issues/2524

   **Which part is this question about**
   So far, the `Buffer` doesn't have its own length, which means you can't slice on data with the length you want.:
   ```rust
   pub struct Buffer {
       /// the internal byte buffer.
       data: Arc<Bytes>,
   
       /// The offset into the buffer.
       offset: usize,
   }
   ```
   This is an old question, and related to some bugs (such as #807), and some performance issues (such as #2510)
   I reopen this question because we don't reach a consensus.
   
   Personally, I hope `Buffer` could behave like slice such as `&[u8]`, but we need more discussion.
   
   Additionally, I hope we could reach a consensus, for example:
   - We should add the `length` field, because ... 
   - we don't need to add this field, because ...
   
   **Describe your question**
   <!--
   A clear and concise description of what the question is.
   -->
   
   **Additional context**
   <!--
   Add any other context about the problem here.
   -->
   


-- 
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.apache.org

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


[GitHub] [arrow-rs] HaoYang670 commented on issue #2524: Add the `length` field for `Buffer`

Posted by GitBox <gi...@apache.org>.
HaoYang670 commented on issue #2524:
URL: https://github.com/apache/arrow-rs/issues/2524#issuecomment-1223407620

   Thank you, @tustvold. I will try your suggestion and file a draft PR. (maybe need more help from you)


-- 
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 issue #2524: Add the `length` field for `Buffer`

Posted by GitBox <gi...@apache.org>.
tustvold commented on issue #2524:
URL: https://github.com/apache/arrow-rs/issues/2524#issuecomment-1220661945

   I would suggest lifting the length out of `Bytes` onto `Buffer`, this way we avoid redundant information


-- 
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 closed issue #2524: Add the `length` field for `Buffer`

Posted by GitBox <gi...@apache.org>.
tustvold closed issue #2524: Add the `length` field for `Buffer`
URL: https://github.com/apache/arrow-rs/issues/2524


-- 
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