Skip to content

Commit

Permalink
Revert "[Fix](match) fix match null for no index"
Browse files Browse the repository at this point in the history
This reverts commit 533adb1.
  • Loading branch information
airborne12 committed Oct 12, 2024
1 parent e6607b8 commit 9b6c56c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 30 deletions.
16 changes: 3 additions & 13 deletions be/src/vec/exprs/vmatch_predicate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,9 @@ Status VMatchPredicate::prepare(RuntimeState* state, const RowDescriptor& desc,
argument_template.emplace_back(nullptr, child->data_type(), child->expr_name());
child_expr_name.emplace_back(child->expr_name());
}
// result column always not null
if (_data_type->is_nullable()) {
_function = SimpleFunctionFactory::instance().get_function(
_fn.name.function_name, argument_template, remove_nullable(_data_type));
} else {
_function = SimpleFunctionFactory::instance().get_function(_fn.name.function_name,
argument_template, _data_type);
}

_function = SimpleFunctionFactory::instance().get_function(_fn.name.function_name,
argument_template, _data_type);
if (_function == nullptr) {
std::string type_str;
for (auto arg : argument_template) {
Expand Down Expand Up @@ -170,11 +165,6 @@ Status VMatchPredicate::execute(VExprContext* context, Block* block, int* result
RETURN_IF_ERROR(_function->execute(context->fn_context(_fn_context_index), *block, arguments,
num_columns_without_result, block->rows(), false));
*result_column_id = num_columns_without_result;
if (_data_type->is_nullable()) {
auto nested = block->get_by_position(num_columns_without_result).column;
auto nullable = ColumnNullable::create(nested, ColumnUInt8::create(block->rows(), 0));
block->replace_by_position(num_columns_without_result, nullable);
}
return Status::OK();
}

Expand Down
17 changes: 2 additions & 15 deletions be/src/vec/functions/match.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,7 @@ Status FunctionMatchBase::execute_impl(FunctionContext* context, Block& block,
const auto* values = check_and_get_column<ColumnString>(source_col.get());
const ColumnArray* array_col = nullptr;
if (source_col->is_column_array()) {
if (source_col->is_nullable()) {
auto* nullable = check_and_get_column<ColumnNullable>(source_col.get());
array_col = check_and_get_column<ColumnArray>(*nullable->get_nested_column_ptr());
} else {
array_col = check_and_get_column<ColumnArray>(source_col.get());
}
array_col = check_and_get_column<ColumnArray>(source_col.get());
if (array_col && !array_col->get_data().is_column_string()) {
return Status::NotSupported(
fmt::format("unsupported nested array of type {} for function {}",
Expand All @@ -128,15 +123,7 @@ Status FunctionMatchBase::execute_impl(FunctionContext* context, Block& block,
values = check_and_get_column<ColumnString>(*(array_col->get_data_ptr()));
}
} else if (auto* nullable = check_and_get_column<ColumnNullable>(source_col.get())) {
// match null
if (type_ptr->is_nullable()) {
if (column_ptr->only_null()) {
block.get_by_position(result).column = nullable->get_null_map_column_ptr();
return Status::OK();
}
} else {
values = check_and_get_column<ColumnString>(*nullable->get_nested_column_ptr());
}
values = check_and_get_column<ColumnString>(*nullable->get_nested_column_ptr());
}

if (!values) {
Expand Down
2 changes: 0 additions & 2 deletions be/src/vec/functions/match.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ const std::string MATCH_PHRASE_EDGE_FUNCTION = "match_phrase_edge";

class FunctionMatchBase : public IFunction {
public:
bool use_default_implementation_for_nulls() const override { return false; }

size_t get_number_of_arguments() const override { return 2; }

String get_name() const override { return "match"; }
Expand Down

0 comments on commit 9b6c56c

Please sign in to comment.