lxy-9602 commented on code in PR #391:
URL: https://github.com/apache/paimon-cpp/pull/391#discussion_r4113898116
##########
src/paimon/common/predicate/like.h:
##########
@@ -45,4 +46,6 @@ class Like : public StringLeafBinaryFunction {
private:
Like() = default;
};
+
+PAIMON_EXPORT Result<bool> TestLikeString(const std::string& field, const
std::string& pattern);
Review Comment:
Thanks for fixing this issue!
Would it be possible to avoid introducing the namespace-level
`TestLikeString` function? We could export only a static member of `Like`
instead:
```cpp
class Like : public StringLeafBinaryFunction {
public:
PAIMON_EXPORT static Result<bool> MatchString(
const std::string& field,
const std::string& pattern);
Result<bool> TestString(
const std::string& field,
const std::string& pattern) const override;
};
```
Then the bitmap reader could call:
```cpp
return paimon::Like::MatchString(
key.GetValue<std::string>(), pattern);
```
`MatchString` could contain the existing matching implementation, while the
virtual `TestString` delegates to it. This would keep the functionality scoped
to `Like` while exporting only one static member symbol, without exposing the
class hierarchy, vtable, or RTTI across shared-library boundaries.
What do you think?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]