From 80d7fbd9eaf613411e5a2cbe3a2202cdf4b862a3 Mon Sep 17 00:00:00 2001 From: Hector Date: Mon, 4 Nov 2024 15:19:24 -0800 Subject: [PATCH 1/2] comment out step 4 in array_map_expr --- be/src/exprs/array_map_expr.cpp | 35 +++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/be/src/exprs/array_map_expr.cpp b/be/src/exprs/array_map_expr.cpp index fa905b97951d3..522d315800506 100644 --- a/be/src/exprs/array_map_expr.cpp +++ b/be/src/exprs/array_map_expr.cpp @@ -139,22 +139,27 @@ StatusOr ArrayMapExpr::evaluate_lambda_expr(ExprContext* context, Chu } DCHECK(aligned_offsets != nullptr); + + // XXX + // we have already evaluated _outer_common_exprs in step 1 + // it does not seems to be necessary to add all referenced columns here again + // 4. prepare outer common exprs - for (const auto& [slot_id, expr] : _outer_common_exprs) { - auto column = chunk->get_column_by_slot_id(slot_id); - column = ColumnHelper::unpack_and_duplicate_const_column(column->size(), column); - if constexpr (independent_lambda_expr) { - // if lambda expr doesn't rely on arguments, we don't need to align offset - cur_chunk->append_column(column, slot_id); - } else { - if (column->is_array()) { - auto view_column = ArrayViewColumn::from_array_column(column); - cur_chunk->append_column(view_column->replicate(aligned_offsets->get_data()), slot_id); - } else { - cur_chunk->append_column(column->replicate(aligned_offsets->get_data()), slot_id); - } - } - } + //for (const auto& [slot_id, expr] : _outer_common_exprs) { + // auto column = chunk->get_column_by_slot_id(slot_id); + // column = ColumnHelper::unpack_and_duplicate_const_column(column->size(), column); + // if constexpr (independent_lambda_expr) { + // // if lambda expr doesn't rely on arguments, we don't need to align offset + // cur_chunk->append_column(column, slot_id); + // } else { + // if (column->is_array()) { + // auto view_column = ArrayViewColumn::from_array_column(column); + // cur_chunk->append_column(view_column->replicate(aligned_offsets->get_data()), slot_id); + // } else { + // cur_chunk->append_column(column->replicate(aligned_offsets->get_data()), slot_id); + // } + // } + //} // 5. prepare capture columns for (auto slot_id : capture_slot_ids) { From d9a427390b54221b8a195501928383af29e610e4 Mon Sep 17 00:00:00 2001 From: Hector Date: Tue, 5 Nov 2024 11:21:27 -0800 Subject: [PATCH 2/2] wip --- be/src/exprs/array_map_expr.cpp | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/be/src/exprs/array_map_expr.cpp b/be/src/exprs/array_map_expr.cpp index 522d315800506..a2e785372edaa 100644 --- a/be/src/exprs/array_map_expr.cpp +++ b/be/src/exprs/array_map_expr.cpp @@ -139,28 +139,11 @@ StatusOr ArrayMapExpr::evaluate_lambda_expr(ExprContext* context, Chu } DCHECK(aligned_offsets != nullptr); - - // XXX + // 4. prepare outer common exprs // we have already evaluated _outer_common_exprs in step 1 + // we don't need to add columns referenced in _outer_common_exprs again here. // it does not seems to be necessary to add all referenced columns here again - // 4. prepare outer common exprs - //for (const auto& [slot_id, expr] : _outer_common_exprs) { - // auto column = chunk->get_column_by_slot_id(slot_id); - // column = ColumnHelper::unpack_and_duplicate_const_column(column->size(), column); - // if constexpr (independent_lambda_expr) { - // // if lambda expr doesn't rely on arguments, we don't need to align offset - // cur_chunk->append_column(column, slot_id); - // } else { - // if (column->is_array()) { - // auto view_column = ArrayViewColumn::from_array_column(column); - // cur_chunk->append_column(view_column->replicate(aligned_offsets->get_data()), slot_id); - // } else { - // cur_chunk->append_column(column->replicate(aligned_offsets->get_data()), slot_id); - // } - // } - //} - // 5. prepare capture columns for (auto slot_id : capture_slot_ids) { if (cur_chunk->is_slot_exist(slot_id)) {