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 2020/10/17 20:02:15 UTC

[GitHub] [arrow] nevi-me commented on a change in pull request #8364: ARROW-5350: [Rust] Allow filtering on simple lists

nevi-me commented on a change in pull request #8364:
URL: https://github.com/apache/arrow/pull/8364#discussion_r506978711



##########
File path: rust/arrow/src/compute/kernels/filter.rs
##########
@@ -399,6 +480,99 @@ impl FilterContext {
                     key_type, value_type
                 )))
             }
+            DataType::List(dt) => match &**dt {
+                DataType::UInt8 => {
+                    filter_primitive_item_list_array!(self, array, UInt8Type)
+                }
+                DataType::UInt16 => {
+                    filter_primitive_item_list_array!(self, array, UInt16Type)
+                }
+                DataType::UInt32 => {
+                    filter_primitive_item_list_array!(self, array, UInt32Type)
+                }
+                DataType::UInt64 => {
+                    filter_primitive_item_list_array!(self, array, UInt64Type)
+                }
+                DataType::Int8 => filter_primitive_item_list_array!(self, array, Int8Type),
+                DataType::Int16 => {
+                    filter_primitive_item_list_array!(self, array, Int16Type)
+                }
+                DataType::Int32 => {
+                    filter_primitive_item_list_array!(self, array, Int32Type)
+                }
+                DataType::Int64 => {
+                    filter_primitive_item_list_array!(self, array, Int64Type)
+                }
+                DataType::Float32 => {
+                    filter_primitive_item_list_array!(self, array, Float32Type)
+                }
+                DataType::Float64 => {
+                    filter_primitive_item_list_array!(self, array, Float64Type)
+                }
+                DataType::Boolean => {
+                    filter_primitive_item_list_array!(self, array, BooleanType)
+                }
+                DataType::Date32(_) => {
+                    filter_primitive_item_list_array!(self, array, Date32Type)
+                }
+                DataType::Date64(_) => {
+                    filter_primitive_item_list_array!(self, array, Date64Type)
+                }
+                DataType::Time32(TimeUnit::Second) => {
+                    filter_primitive_item_list_array!(self, array, Time32SecondType)
+                }
+                DataType::Time32(TimeUnit::Millisecond) => {
+                    filter_primitive_item_list_array!(self, array, Time32MillisecondType)
+                }
+                DataType::Time64(TimeUnit::Microsecond) => {
+                    filter_primitive_item_list_array!(self, array, Time64MicrosecondType)
+                }
+                DataType::Time64(TimeUnit::Nanosecond) => {
+                    filter_primitive_item_list_array!(self, array, Time64NanosecondType)
+                }
+                DataType::Duration(TimeUnit::Second) => {
+                    filter_primitive_item_list_array!(self, array, DurationSecondType)
+                }
+                DataType::Duration(TimeUnit::Millisecond) => {
+                    filter_primitive_item_list_array!(self, array, DurationMillisecondType)
+                }
+                DataType::Duration(TimeUnit::Microsecond) => {
+                    filter_primitive_item_list_array!(self, array, DurationMicrosecondType)
+                }
+                DataType::Duration(TimeUnit::Nanosecond) => {
+                    filter_primitive_item_list_array!(self, array, DurationNanosecondType)
+                }
+                DataType::Timestamp(TimeUnit::Second, _) => {
+                    filter_primitive_item_list_array!(self, array, TimestampSecondType)
+                }
+                DataType::Timestamp(TimeUnit::Millisecond, _) => {
+                    filter_primitive_item_list_array!(self, array, TimestampMillisecondType)
+                }
+                DataType::Timestamp(TimeUnit::Microsecond, _) => {
+                    filter_primitive_item_list_array!(self, array, TimestampMicrosecondType)
+                }
+                DataType::Timestamp(TimeUnit::Nanosecond, _) => {
+                    filter_primitive_item_list_array!(self, array, TimestampNanosecondType)
+                }
+                DataType::Binary => filter_non_primitive_item_list_array!(
+                    self,
+                    array,
+                    BinaryArray,
+                    BinaryBuilder
+                ),
+                DataType::Utf8 => filter_non_primitive_item_list_array!(

Review comment:
       I've added largeutf8, largebinary and largelist. I'll work on test coverage separately




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