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 2021/01/17 22:55:37 UTC

[GitHub] [arrow] jhorstmann commented on a change in pull request #9212: ARROW-11265: [Rust] Made bool not ArrowNativeType

jhorstmann commented on a change in pull request #9212:
URL: https://github.com/apache/arrow/pull/9212#discussion_r559251445



##########
File path: rust/arrow/src/datatypes.rs
##########
@@ -199,11 +199,18 @@ pub struct Field {
     metadata: Option<BTreeMap<String, String>>,
 }
 
-pub trait ArrowNativeType:
-    fmt::Debug + Send + Sync + Copy + PartialOrd + FromStr + Default + 'static
-{
+/// Trait declaring any type that is serializable to JSON. This includes all primitive types (bool, i32, etc.).
+pub trait JsonSerializable: 'static {
     fn into_json_value(self) -> Option<Value>;
+}
 
+/// Trait expressing a Rust type that has the same in-memory representation
+/// as Arrow. This includes `i16`, `f32`, but excludes `bool` (which in arrow is represented in bits).
+/// In little endian machines, types that implement [`ArrowNativeType`] can be memcopied to arrow buffers

Review comment:
       Does the in-memory format require little-endian? I'd expect conversion to happen when reading data into memory, which should make memcpy work on bot LE and BE machines. Assuming absence of other endianness bugs of course.




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

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