zclllyybb commented on code in PR #64175:
URL: https://github.com/apache/doris/pull/64175#discussion_r3369740163
##########
be/src/exprs/function/array/function_array_element.h:
##########
@@ -173,21 +190,23 @@ class FunctionArrayElement : public IFunction {
ColumnPtr _execute_number(const ColumnArray::Offsets64& offsets, const
IColumn& nested_column,
const UInt8* arr_null_map, const IColumn&
indices,
const UInt8* nested_null_map, UInt8*
dst_null_map,
- const UInt8* idx_null_map, bool is_const_index)
const {
+ const UInt8* idx_null_map, bool is_const_index,
bool is_const_array,
+ size_t input_rows_count) const {
const auto& nested_data = reinterpret_cast<const
ColumnType&>(nested_column).get_data();
const auto& index_data = assert_cast<const
IndexColumnType&>(indices).get_data();
auto dst_column = nested_column.clone_empty();
auto& dst_data = reinterpret_cast<ColumnType&>(*dst_column).get_data();
- dst_data.resize(offsets.size());
+ dst_data.resize(input_rows_count);
- for (size_t row = 0; row < offsets.size(); ++row) {
- size_t off = row == 0 ? 0 : offsets[row - 1];
- size_t len = offsets[row] - off;
+ for (size_t row = 0; row < input_rows_count; ++row) {
+ size_t arr_row = index_check_const(row, is_const_array);
+ size_t off = arr_row == 0 ? 0 : offsets[arr_row - 1];
Review Comment:
chore: no need to do this check
--
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]