Commits


Chao Sun authored and Wes McKinney committed 1209a80fc63
ARROW-2583: [Rust] Buffer should be typeless This changes the existing `Buffer` class to be non-generic over type `T`, since a `Buffer` class should just represent a plain byte array and interpretation of the data within the buffer should be done on a higher level, such as in `Array`. While working on this, I found that I also need to make significant changes on the `Array` and `List` types, since they are currently heavily tied with the `Buffer<T>` implementation. The new implementation follows arrow-cpp and defines a `ArrayData` struct which provides the common operations on a Arrow array. Subtypes of `Array` then provide specific operations for the types they represent. For instance, one can get a primitive value at index `i` for `PrimitiveArray` type, or can get a column at index `i` for `StructArray`. I removed `List` since it's no longer necessary. Removed `PrimitiveArray::{min,max}` for now but plan to add them back. Author: Chao Sun <sunchao@uber.com> Closes #2330 from sunchao/ARROW-2583 and squashes the following commits: 91c580b8 <Chao Sun> Fix lint 0e8a8dc9 <Chao Sun> Address review comments 21b8d1df <Chao Sun> Fix lint 2493d122 <Chao Sun> Fix a few more issues and add more tests 383cc3ef <Chao Sun> More refactoring 2ee3cf95 <Chao Sun> Fix lint a29ae4a2 <Chao Sun> Fix test for is_aligned c1941651 <Chao Sun> Fix Buffer offset and test for Array alignment a3206cc5 <Chao Sun> Address review comments 18634481 <Chao Sun> Fix lint 1e8dab51 <Chao Sun> In is_aligned(), should use align_of instead of size_of 363e7cfc <Chao Sun> Fix bench. Change Buffer#copy() to Buffer#clone() 042796b4 <Chao Sun> Add check for pointer alignment 18e5dead <Chao Sun> Address comments 51327fed <Chao Sun> Address comments ac782f14 <Chao Sun> Remove commented out code 08fb8479 <Chao Sun> Fix to_bytes() collision and test failure c3c0f6c5 <Chao Sun> Fix style 83e1a1fd <Chao Sun> Bring back min and max for PrimitiveArray 7e57fd0d <Chao Sun> ARROW-2583: Buffer should be typeless