public abstract class LikeExpression extends BaseCompoundExpression
BaseExpression.ExpressionComparabilityWrapper
children
Constructor and Description |
---|
LikeExpression() |
LikeExpression(List<Expression> children) |
Modifier and Type | Method and Description |
---|---|
<T> T |
accept(ExpressionVisitor<T> visitor)
Means of traversing expression tree through visitor.
|
protected static List<Expression> |
addLikeTypeChild(List<Expression> children,
LikeParseNode.LikeType likeType) |
abstract LikeExpression |
clone(List<Expression> children) |
protected AbstractBasePattern |
compilePattern(String value) |
protected abstract AbstractBasePattern |
compilePatternSpec(String value) |
boolean |
endsWithOnlyWildcard() |
boolean |
evaluate(Tuple tuple,
ImmutableBytesWritable ptr)
Access the value by setting a pointer to it (as opposed to making
a copy of it which can be expensive)
|
PDataType |
getDataType() |
LikeParseNode.LikeType |
getLikeType() |
String |
getLiteralPrefix() |
static String |
getStartsWithPrefix(String s) |
static boolean |
hasWildcards(String s) |
static int |
indexOfWildcard(String s) |
void |
readFields(DataInput input) |
boolean |
startsWithWildcard() |
String |
toString() |
static String |
unescapeLike(String s) |
static String |
wildCardToLike(String s)
Replace unescaped '*' and '?' in s with '%' and '_' respectively
such that the returned string may be used in a LIKE expression.
|
void |
write(DataOutput output) |
equals, getChildren, getDeterminism, hashCode, isNullable, isStateless, requiresFinalEvaluation, reset
acceptChildren, coerce, coerce, getMaxLength, getScale, getSortOrder
public LikeExpression()
public LikeExpression(List<Expression> children)
public static String getStartsWithPrefix(String s)
public static boolean hasWildcards(String s)
public static String wildCardToLike(String s)
s
- wildcard pattern that may use '*' for multi character
match and '?' for single character match, escaped by the backslash
characterpublic static int indexOfWildcard(String s)
protected static List<Expression> addLikeTypeChild(List<Expression> children, LikeParseNode.LikeType likeType)
public LikeParseNode.LikeType getLikeType()
public boolean startsWithWildcard()
protected abstract AbstractBasePattern compilePatternSpec(String value)
protected AbstractBasePattern compilePattern(String value)
public boolean evaluate(Tuple tuple, ImmutableBytesWritable ptr)
Expression
tuple
- Single row result during scan iterationptr
- Pointer to byte value being accessedpublic void readFields(DataInput input) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
readFields
in class BaseCompoundExpression
IOException
public void write(DataOutput output) throws IOException
write
in interface org.apache.hadoop.io.Writable
write
in class BaseCompoundExpression
IOException
public PDataType getDataType()
public final <T> T accept(ExpressionVisitor<T> visitor)
Expression
public String getLiteralPrefix()
public boolean endsWithOnlyWildcard()
public String toString()
toString
in class BaseCompoundExpression
public abstract LikeExpression clone(List<Expression> children)
Copyright © 2019 Apache Software Foundation. All Rights Reserved.