ZhangHuiGui commented on code in PR #41380:
URL: https://github.com/apache/arrow/pull/41380#discussion_r1579588142


##########
cpp/src/arrow/compute/kernels/scalar_if_else.cc:
##########
@@ -1482,39 +1482,21 @@ Status ExecScalarCaseWhen(KernelContext* ctx, const 
ExecSpan& batch, ExecResult*
     result = temp.get();
   }
 
-  // TODO(wesm): clean this up to have less duplication
-  if (out->is_array_data()) {

Review Comment:
   This logic will never be executed.
   The only way go into the `ArrayData`'s path is input type is not 
`fixed_width`:
   
https://github.com/apache/arrow/blob/32885c91a1c94f1c8530815f4d4b8fc068859de8/cpp/src/arrow/compute/kernels/scalar_if_else.cc#L2691-L2695.
   
   The non-fixed-width's type has their own `CaseWhenFunctor` like: 
   ```c
   struct CaseWhenFunctor<DictionaryType> {...}
   struct CaseWhenFunctor<Type, enable_if_union<Type>> {...}
   struct CaseWhenFunctor<FixedSizeListType> {...}
   struct CaseWhenFunctor<StructType>{...}
   struct CaseWhenFunctor<MapType>{...}
   struct CaseWhenFunctor<Type, enable_if_var_size_list<Type>> {...}
   struct CaseWhenFunctor<Type, enable_if_base_binary<Type>> {...}
   ```
   



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

Reply via email to