github-actions[bot] commented on code in PR #66234:
URL: https://github.com/apache/doris/pull/66234#discussion_r3674145877


##########
be/src/exprs/function/array/function_array_apply.cpp:
##########
@@ -176,14 +168,14 @@ class FunctionArrayApply : public IFunction {
     }
 
     template <ApplyOp OP>
-    void dispatch_array_scalar(DataTypePtr nested_type, const IColumn& 
src_column,
-                               const ColumnArray::Offsets64& src_offsets, 
const ColumnConst& cmp,
+    void dispatch_array_scalar(const ColumnPtr& array_column, DataTypePtr 
nested_type,
+                               const IColumn& src_column, const ColumnConst& 
cmp,
                                ColumnPtr* dst) const {
         auto call = [&](const auto& type) -> bool {
             using DispatchType = std::decay_t<decltype(type)>;
             constexpr PrimitiveType PType = DispatchType::PType;
-            *dst = _apply_internal<typename 
PrimitiveTypeTraits<PType>::CppType, OP>(
-                    src_column, src_offsets, cmp);
+            auto array_view = ColumnArrayView<PType>::create(array_column);

Review Comment:
   This new view instantiation currently breaks the BE build for decimal 
arrays. `dispatch_switch_scalar` instantiates 
`ColumnArrayView<TYPE_DECIMAL32/64/V2>` here, but this translation unit does 
not include the complete `ColumnDecimal` definition, so the live macOS BE UT 
fails in `column_execute_util.h` with `implicit instantiation of undefined 
template 'doris::ColumnDecimal<...>'`. Please include 
`core/column/column_decimal.h` here (or make the view header provide the 
concrete type it requires) so every supported scalar instantiation compiles.



##########
be/src/exprs/function/array/function_array_element.h:
##########
@@ -464,16 +464,10 @@ class FunctionArrayElement : public IFunction {
         const auto& array_column = assert_cast<const 
ColumnArray&>(*arguments[0].column);
         const auto& offsets = array_column.get_offsets();
         DCHECK(is_const_array ? offsets.size() == 1 : offsets.size() == 
input_rows_count);
-        const UInt8* nested_null_map = nullptr;
-        ColumnPtr nested_column = nullptr;
-        if (is_column_nullable(array_column.get_data())) {
-            const auto& nested_null_column =
-                    reinterpret_cast<const 
ColumnNullable&>(array_column.get_data());
-            nested_null_map = 
nested_null_column.get_null_map_column().get_data().data();
-            nested_column = nested_null_column.get_nested_column_ptr();
-        } else {
-            nested_column = array_column.get_data_ptr();
-        }
+        const auto& nested_null_column =

Review Comment:
   This helper is also used by `_execute_map`, which wraps 
`ColumnMap::get_values_ptr()` in a synthetic `ColumnArray`. `DataTypeMap` 
preserves each declared child type, so a valid map with a non-nullable value 
type has a plain `ColumnInt32`/`ColumnString` here rather than 
`ColumnNullable`; this unconditional cast then fails instead of returning the 
mapped value. The Array storage invariant does not cover that synthetic 
map-value array. Please retain conditional unwrapping for this shared path (or 
split the map and true-array paths), and add a non-nullable-map-value 
`element_at` test.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to