Conversation
core/trino-main/src/main/java/io/trino/likematcher/DenseDfaMatcher.java
Outdated
Show resolved
Hide resolved
e2ebef6 to
8c3e370
Compare
core/trino-main/src/main/java/io/trino/likematcher/LikeMatcher.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/likematcher/LikeMatcher.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/likematcher/LikeMatcher.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/likematcher/LikeMatcher.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/likematcher/LikeMatcher.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/likematcher/DenseDfaMatcher.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/likematcher/LikeMatcher.java
Outdated
Show resolved
Hide resolved
jirassimok
left a comment
There was a problem hiding this comment.
Looking through how this PR works, I think there's something of an extra step here in the construction of the DFA. It looks like the DFA class is only used as a transitory state between NFA and DenseDfaMatcher, the latter of which actually functions as a DFA.
I wonder if replacing the current DFA with a DFA builder and renaming DenseDfaMatcher to DFA might be a better idea.
Either way, I think the part of LikeMatcher.compile that essentially compiles a DFA should be moved to its own method on the current DFA class.
The DFA class is an abstract description of the DFA (useful for understanding the states and transitions). The one used by DfaMatcher is a physical version designed for efficient matching.
You make a good point. That bit of code should actually go in DenseDfaMatcher, which should provide a method for constructing a instance of that class from the abstract representation of the DFA. |
core/trino-main/src/main/java/io/trino/type/LikePatternType.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/test/java/io/trino/operator/scalar/BenchmarkLike.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/test/java/io/trino/operator/scalar/BenchmarkLike.java
Outdated
Show resolved
Hide resolved
phd3
left a comment
There was a problem hiding this comment.
lgtm, just one pending comment about likepattern serde
core/trino-main/src/main/java/io/trino/likematcher/LikeMatcher.java
Outdated
Show resolved
Hide resolved
ad2737e to
f374887
Compare
Implements a dedicated NFA/DFA-based matcher for LIKE expressions.
Implements a dedicated NFA/DFA-based matcher for LIKE expressions.
Before:
After:
Documentation
(x) No documentation is needed.
Release notes
(x) Release notes entries required with the following suggested text: