-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Regexp count #51501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Regexp count #51501
Conversation
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run buildall
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run buildall
|
||
DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | ||
auto int64_type = std::make_shared<DataTypeInt64>(); | ||
return make_nullable(std::static_pointer_cast<const IDataType>(int64_type)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could return make_nullable(std::make_shared());
if (scope == FunctionContext::THREAD_LOCAL) { | ||
auto ptr = context->get_function_state(scope); | ||
if (ptr) { | ||
delete reinterpret_cast<re2::RE2*>(ptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seeme you set is std::shared_ptrre2::RE2, it's need the delete?
auto result_null_map = ColumnUInt8::create(input_rows_count, 0); | ||
auto result_data_column = ColumnInt64::create(); | ||
auto& result_data = result_data_column->get_data(); | ||
result_data.resize(input_rows_count); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto result_data_column = ColumnInt64::create(input_rows_count);
|
||
argument_columns[1] = col_const[1] ? static_cast<const ColumnConst&>( | ||
*block.get_by_position(arguments[1]).column) | ||
.convert_to_full_column() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the const column you seem not used and argument_columns[0] and [1] are all need convert_to_full column,
maybe could diretly:
for loop {
argument_columns[i] = block.get_by_position(arguments[0]).column).convert_to_full_column()
}
const auto* str = check_and_get_column<ColumnString>(argument_columns[0].get()); | ||
|
||
for (size_t i = 0; i < input_rows_count; ++i) { | ||
if (null_map[i]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the check is used for ?? you null_map seems is result_null_map->get_data()
and the null_map is init value is 0,
const size_t index_now) { | ||
re2::RE2* re = reinterpret_cast<re2::RE2*>( | ||
context->get_function_state(FunctionContext::THREAD_LOCAL)); | ||
std::unique_ptr<re2::RE2> scoped_re; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not used scoped_re?
and maybe could add check re is not nullptr
|
||
int64_t count = 0; | ||
size_t pos = 0; | ||
re2::StringPiece str_sp(str_data.data, str_data.size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not used str_sp?
pos++; | ||
} else { | ||
count++; | ||
pos += match.data() - current.data() + match.size(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could add some docment about
pos += match.data() - current.data() + match.size();
run buildall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please wait some time ,i will fix these problem soon
What problem does this PR solve?
Issue Number: close #51350
Related PR: #xxx
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)