Class ContainsExprMacro
- java.lang.Object
-
- org.apache.druid.query.expression.ContainsExprMacro
-
- All Implemented Interfaces:
ExprMacroTable.ExprMacro
,NamedFunction
public class ContainsExprMacro extends Object implements ExprMacroTable.ExprMacro
This class implements a function that checks if one string contains another string. It is required that second string be a literal. This expression is case-sensitive. signature: long contains_string(string, string)Examples: -
contains_string("foobar", "bar") - 1
-contains_string("foobar", "car") - 0
-contains_string("foobar", "Bar") - 0
See
CaseInsensitiveContainsExprMacro
for the case-insensitive version.
-
-
Constructor Summary
Constructors Constructor Description ContainsExprMacro()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Expr
apply(List<Expr> args)
String
name()
Name of the function-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.druid.math.expr.NamedFunction
processingFailed, validationFailed, validationFailed, validationHelperCheckAnyOfArgumentCount, validationHelperCheckArgIsLiteral, validationHelperCheckArgumentCount, validationHelperCheckArgumentCount, validationHelperCheckArgumentRange, validationHelperCheckLambaArgumentCount, validationHelperCheckMinArgumentCount, validationHelperCheckMinArgumentCount
-
-
-
-
Field Detail
-
FN_NAME
public static final String FN_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
name
public String name()
Description copied from interface:NamedFunction
Name of the function- Specified by:
name
in interfaceNamedFunction
-
apply
public Expr apply(List<Expr> args)
- Specified by:
apply
in interfaceExprMacroTable.ExprMacro
-
-