Skip to content

[CH] The function replace report an error with null value #5959

@loneylee

Description

@loneylee

Backend

CH (ClickHouse)

Bug description

With run the follow sql

create table tableName(src String, idx String, dest String) using parquet;
nsert into tableName values  (1, null, 2);
select REPLACE(src, idx, dest) from tableName;

Then report an error as

Caused by: org.apache.gluten.exception.GlutenException: Length of the pattern argument in function replaceAll must be greater than 0.: while executing 'FUNCTION replaceAll(17 : 2, 2 : 0, 17 : 2) -> replaceAll(17,2,17) Nullable(String) : 3'
0. Poco::Exception::Exception(String const&, int) @ 0x000000001225d4b9
1. DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x000000000aeab33b
2. DB::Exception::Exception(PreformattedMessage&&, int) @ 0x00000000060c5a0c
3. DB::Exception::Exception<char const* const&>(int, FormatStringHelperImpl<std::type_identity<char const* const&>::type>, char const* const&) @ 0x00000000061f096b
4. DB::FunctionStringReplace<DB::ReplaceStringImpl<DB::(anonymous namespace)::NameReplaceAll, (DB::ReplaceStringTraits::Replace)1>, DB::(anonymous namespace)::NameReplaceAll>::executeImpl(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long) const @ 0x0000000009fa1b0d
5. DB::FunctionToExecutableFunctionAdaptor::executeImpl(std::vector<DB::ColumnWithTypeAndName, std::allocator<DB::ColumnWithTypeAndName>> const&, std::shared_ptr<DB::IDataType const> const&, unsigned long) const @ 0x0000000006491d2e

In Clickhouse, it accured same error.

Spark version

None

Spark configurations

No response

System information

No response

Relevant logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions