korowa commented on code in PR #5858:
URL: https://github.com/apache/arrow-rs/pull/5858#discussion_r1644956911
##########
arrow-row/src/lib.rs:
##########
@@ -1146,9 +1146,21 @@ fn encode_column(
match encoder {
Encoder::Stateless => {
downcast_primitive_array! {
- column => fixed::encode(data, offsets, column, opts),
+ column => {
+ if column.is_nullable(){
Review Comment:
After switching to this expression, I've found out that it's more beneficial
to iterate over `null`, picking valid values from `values` -- now nullable
columns conversions is +- close to non-nullable
##########
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:
Done
--
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]