Class AbstractSqlPatternMatcher
java.lang.Object
org.apache.drill.exec.expr.fn.impl.AbstractSqlPatternMatcher
- All Implemented Interfaces:
SqlPatternMatcher
- Direct Known Subclasses:
SqlPatternConstantMatcher
,SqlPatternContainsMatcher
,SqlPatternEndsWithMatcher
,SqlPatternStartsWithMatcher
To get good performance for most commonly used pattern matches
CONSTANT('ABC')
SqlPatternConstantMatcher
STARTSWITH('%ABC') SqlPatternStartsWithMatcher
ENDSWITH('ABC%') SqlPatternEndsWithMatcher
CONTAINS('%ABC%') SqlPatternContainsMatcher
we have simple pattern matchers.
Idea is to have our own implementation for simple pattern matchers so we can
avoid heavy weight regex processing, skip UTF-8 decoding and char conversion.
Instead, we encode the pattern string and do byte comparison against native memory.
Overall, this approach
gives us orders of magnitude performance improvement for simple pattern matches.
Anything that is not simple is considered
complex pattern and we use Java regex for complex pattern matches.-
Field Summary
Modifier and TypeFieldDescriptionprotected final ByteBuffer
protected final int
protected final String
-
Constructor Summary
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.drill.exec.expr.fn.impl.SqlPatternMatcher
match
-
Field Details
-
patternString
-
patternLength
protected final int patternLength -
patternByteBuffer
-
-
Constructor Details
-
AbstractSqlPatternMatcher
-