Skip to content
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

[Feature] support regex_instr #36958

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'upstream/main' into regexp_instr
Conflicts:
	be/test/exprs/string_fn_test.cpp
  • Loading branch information
liuzhixing1006 committed Dec 13, 2023
commit a62a2b61b7184b1606d770469e7d289280aa5f3d
14 changes: 14 additions & 0 deletions be/test/exprs/string_fn_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3756,6 +3756,20 @@ PARALLEL_TEST(VecStringFunctionsTest, regexpInstrConstPattern) {
for (int i = 0; i < sizeof(strs) / sizeof(strs[0]); ++i) {
ASSERT_EQ(res[i], result->debug_item(i));
}

PARALLEL_TEST(VecStringFunctionsTest, crc32Test) {
std::unique_ptr<FunctionContext> ctx(FunctionContext::create_test_context());
Columns columns;
auto str = BinaryColumn::create();
str->append("starrocks");
str->append("STARROCKS");
columns.push_back(str);

ASSERT_TRUE(StringFunctions::crc32(ctx.get(), columns).ok());
ColumnPtr result = StringFunctions::crc32(ctx.get(), columns).value();
auto v = ColumnHelper::cast_to<TYPE_BIGINT>(result);
ASSERT_EQ(static_cast<uint32_t>(2312449062), v->get_data()[0]);
ASSERT_EQ(static_cast<uint32_t>(3440849609), v->get_data()[1]);
}

} // namespace starrocks
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.