Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LemonLiTree committed Apr 18, 2024
1 parent abb29a5 commit dae9bf3
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions be/src/vec/functions/function_jsonb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1158,7 +1158,7 @@ class FunctionJsonbContains : public IFunction {
static FunctionPtr create() { return std::make_shared<FunctionJsonbContains<Impl>>(); }

DataTypePtr get_return_type_impl(const DataTypes& arguments) const override {
return make_nullable(std::make_shared<DataTypeUInt8>());
return std::make_shared<DataTypeUInt8>();
}
DataTypes get_variadic_argument_types_impl() const override {
return Impl::get_variadic_argument_types();
Expand All @@ -1167,8 +1167,6 @@ class FunctionJsonbContains : public IFunction {
return get_variadic_argument_types_impl().size();
}

bool use_default_implementation_for_nulls() const override { return false; }

Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments,
size_t result, size_t input_rows_count) const override {
return Impl::execute_impl(context, block, arguments, result, input_rows_count);
Expand Down Expand Up @@ -1244,8 +1242,7 @@ struct JsonbContainsUtil {
res->insert_data(const_cast<const char*>((char*)&contains_value), 0);
}

block.replace_by_position(result,
ColumnNullable::create(std::move(res), std::move(null_map)));
block.replace_by_position(result, std::move(res));
return Status::OK();
}
};
Expand Down Expand Up @@ -1295,13 +1292,11 @@ class FunctionJsonbDepth : public IFunction {
static FunctionPtr create() { return std::make_shared<FunctionJsonbDepth>(); }

DataTypePtr get_return_type_impl(const DataTypes& arguments) const override {
return make_nullable(std::make_shared<DataTypeInt32>());
return std::make_shared<DataTypeInt32>();
}

size_t get_number_of_arguments() const override { return 1; }

bool use_default_implementation_for_nulls() const override { return false; }

Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments,
size_t result, size_t input_rows_count) const override {
DCHECK_GE(arguments.size(), 1);
Expand Down Expand Up @@ -1332,8 +1327,7 @@ class FunctionJsonbDepth : public IFunction {
res_data[i] = value->depth();
}

block.replace_by_position(
result, ColumnNullable::create(std::move(col_result), std::move(null_map)));
block.replace_by_position(result, std::move(col_result));
return Status::OK();
}
};
Expand Down

0 comments on commit dae9bf3

Please sign in to comment.