Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ Result<RoaringBitmap64> BitmapIndexReader::Like(const Literal& literal) {
if (key.GetType() != FieldType::STRING) {
return false;
}
return paimon::Like::Instance().TestString(key.GetValue<std::string>(), pattern);
return paimon::Like::MatchString(key.GetValue<std::string>(), pattern);
});
}

Expand Down
6 changes: 5 additions & 1 deletion src/paimon/common/predicate/like.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ inline bool IsJavaRegexLineTerminator(const std::string& code_point) {

} // namespace

Result<bool> Like::TestString(const std::string& field, const std::string& pattern) const {
Result<bool> Like::MatchString(const std::string& field, const std::string& pattern) {
if (pattern.empty()) {
return field.empty();
}
Expand Down Expand Up @@ -166,4 +166,8 @@ Result<bool> Like::TestString(const std::string& field, const std::string& patte
}
return static_cast<bool>(dp[n]);
}

Result<bool> Like::TestString(const std::string& field, const std::string& pattern) const {
return MatchString(field, pattern);
}
} // namespace paimon
4 changes: 4 additions & 0 deletions src/paimon/common/predicate/like.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@

#include "paimon/common/predicate/string_leaf_binary_function.h"
#include "paimon/result.h"
#include "paimon/visibility.h"

namespace paimon {
/// A `StringLeafBinaryFunction` to eval filter like.
class Like : public StringLeafBinaryFunction {
public:
PAIMON_EXPORT static Result<bool> MatchString(const std::string& field,
const std::string& pattern);

static const Like& Instance() {
static const Like instance = Like();
return instance;
Expand Down
Loading