tustvold commented on code in PR #5858:
URL: https://github.com/apache/arrow-rs/pull/5858#discussion_r1634818624
##########
arrow-row/src/fixed.rs:
##########
@@ -216,14 +216,80 @@ where
///
/// - 1 byte `0` if null or `1` if valid
/// - bytes of [`FixedLengthEncoding`]
-pub fn encode<T: FixedLengthEncoding, I: IntoIterator<Item = Option<T>>>(
+pub fn encode<T: ArrowPrimitiveType>(
data: &mut [u8],
offsets: &mut [usize],
- i: I,
+ array: &PrimitiveArray<T>,
Review Comment:
One option that would make the nullability explicit whilst also cutting down
on codegen would be to have the following signature instead
```
pub fn encode<T: FixedLengthEncoding>(
data: &mut [u8],
offsets: &mut [usize],
values: &[T],
nulls: &NullBuffer
)
```
```
##########
arrow-row/src/fixed.rs:
##########
@@ -216,14 +216,80 @@ where
///
/// - 1 byte `0` if null or `1` if valid
/// - bytes of [`FixedLengthEncoding`]
-pub fn encode<T: FixedLengthEncoding, I: IntoIterator<Item = Option<T>>>(
+pub fn encode<T: ArrowPrimitiveType>(
data: &mut [u8],
offsets: &mut [usize],
- i: I,
+ array: &PrimitiveArray<T>,
Review Comment:
One option that would make the nullability explicit whilst also cutting down
on codegen would be to have the following signature instead
```
pub fn encode<T: FixedLengthEncoding>(
data: &mut [u8],
offsets: &mut [usize],
values: &[T],
nulls: &NullBuffer
)
```
--
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]