Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
liugddx committed Feb 28, 2024
1 parent 4f577b8 commit d43b8a0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions be/src/vec/functions/function_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -2903,7 +2903,7 @@ class FunctionRandomBytes : public IFunction {

ColumnPtr argument_column =
block.get_by_position(arguments[0]).column->convert_to_full_column_if_const();
const auto* length_col = check_and_get_column<ColumnUInt64>(argument_column.get());
const auto* length_col = check_and_get_column<ColumnInt32>(argument_column.get());

if (!length_col) {
return Status::InternalError("Not supported input argument type");
Expand All @@ -2927,13 +2927,14 @@ class FunctionRandomBytes : public IFunction {
oss << std::setw(2) << std::setfill('0') << std::hex << static_cast<int>(byte);
}

StringOP::push_value_string(oss.str(), i, res_chars, res_offsets);
StringOP::push_value_string("0x" + oss.str(), i, res_chars, res_offsets);
random_bytes.clear();
}

block.get_by_position(result).column = std::move(res);

return Status::OK();

}
};

Expand Down

0 comments on commit d43b8a0

Please sign in to comment.