Skip to content

Commit ee6969e

Browse files
authored
[fix](function) Fix HLL downsample constant column access (#69799)
Related PR: #69257, #69679 Problem Summary: The constant-expression API migration in #69679 missed two calls introduced by #69257, breaking the BE build. Call `ConstantExprResult::column_ptr()` when reading the HLL downsample constant arguments.
1 parent bc57f62 commit ee6969e

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎be/src/exprs/function/function_datasketches_hll.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,13 @@ class FunctionDataSketchesHllDownsample : public IFunction {
9797
// `10 + crc32('') % 2`, may not be evaluated in open either, then it is read from the
9898
// first row in execute.
9999
if (context->is_col_constant(1)) {
100-
RETURN_IF_ERROR(parse_lg_k(*context->get_constant_col(1)->column_ptr, state->lg_k));
100+
RETURN_IF_ERROR(parse_lg_k(*context->get_constant_col(1)->column_ptr(), state->lg_k));
101101
}
102102
if (context->get_num_args() == 2) {
103103
state->tgt_type = datasketches::HLL_4;
104104
} else if (context->is_col_constant(2)) {
105105
RETURN_IF_ERROR(
106-
parse_tgt_type(*context->get_constant_col(2)->column_ptr, state->tgt_type));
106+
parse_tgt_type(*context->get_constant_col(2)->column_ptr(), state->tgt_type));
107107
}
108108
context->set_function_state(scope, state);
109109
return Status::OK();

‎be/test/exprs/function/function_datasketches_hll_test.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,14 @@ class FunctionDataSketchesHllDownsampleTest : public testing::Test {
214214
const auto args = block.get_columns_with_type_and_name();
215215
DataTypes types;
216216
ColumnNumbers indexes;
217-
std::vector<std::shared_ptr<ColumnPtrWrapper>> constants;
217+
std::vector<std::shared_ptr<ConstantExprResult>> constants;
218218
bool nullable = false;
219219
for (size_t i = 0; i < args.size(); ++i) {
220220
types.push_back(args[i].type);
221221
indexes.push_back(i);
222222
nullable |= args[i].type->is_nullable();
223223
constants.push_back(constants_in_open && is_column_const(*args[i].column)
224-
? std::make_shared<ColumnPtrWrapper>(args[i].column)
224+
? std::make_shared<ConstantExprResult>(args[i].column)
225225
: nullptr);
226226
}
227227
auto result_type = nullable ? make_nullable(remove_nullable(types[0])) : types[0];

0 commit comments

Comments
 (0)