org.apache.hadoop.hive.ql.exec.vector.expressions
Class AbstractFilterStringColLikeStringScalar

java.lang.Object
  extended by org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression
      extended by org.apache.hadoop.hive.ql.exec.vector.expressions.AbstractFilterStringColLikeStringScalar
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
FilterStringColLikeStringScalar, FilterStringColRegExpStringScalar

public abstract class AbstractFilterStringColLikeStringScalar
extends VectorExpression

An abstract class for LIKE and REGEXP expressions. LIKE and REGEXP expression share similar functions, but they have different grammars. AbstractFilterStringColLikeStringScalar class provides shared classes and methods. Each subclass handles its grammar.

See Also:
Serialized Form

Nested Class Summary
protected static class AbstractFilterStringColLikeStringScalar.BeginChecker
          Matches the beginning of each string to a pattern.
static interface AbstractFilterStringColLikeStringScalar.Checker
          A Checker contains a pattern and checks whether a given string matches or not.
protected static interface AbstractFilterStringColLikeStringScalar.CheckerFactory
          A CheckerFactory creates checkers of its kind.
protected static class AbstractFilterStringColLikeStringScalar.ComplexChecker
          Matches each string to a pattern with Java regular expression package.
protected static class AbstractFilterStringColLikeStringScalar.EndChecker
          Matches the ending of each string to its pattern.
protected static class AbstractFilterStringColLikeStringScalar.MiddleChecker
          Matches the middle of each string to its pattern.
protected static class AbstractFilterStringColLikeStringScalar.NoneChecker
          Matches the whole string to its pattern.
 
Nested classes/interfaces inherited from class org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression
VectorExpression.Type
 
Field Summary
 
Fields inherited from class org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression
childExpressions, inputTypes, outputType
 
Constructor Summary
AbstractFilterStringColLikeStringScalar()
           
AbstractFilterStringColLikeStringScalar(int colNum, String pattern)
           
 
Method Summary
 void evaluate(VectorizedRowBatch batch)
          This is the primary method to implement expression logic.
protected abstract  List<AbstractFilterStringColLikeStringScalar.CheckerFactory> getCheckerFactories()
           
 int getColNum()
           
 VectorExpressionDescriptor.Descriptor getDescriptor()
           
 int getOutputColumn()
          Returns the index of the output column in the array of column vectors.
 String getOutputType()
          Returns type of the output column.
 String getPattern()
           
 void setColNum(int colNum)
           
 void setPattern(String pattern)
           
 
Methods inherited from class org.apache.hadoop.hive.ql.exec.vector.expressions.VectorExpression
evaluateChildren, getChildExpressions, getInputTypes, setChildExpressions, setInputTypes, setOutputType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractFilterStringColLikeStringScalar

public AbstractFilterStringColLikeStringScalar()

AbstractFilterStringColLikeStringScalar

public AbstractFilterStringColLikeStringScalar(int colNum,
                                               String pattern)
Method Detail

getCheckerFactories

protected abstract List<AbstractFilterStringColLikeStringScalar.CheckerFactory> getCheckerFactories()

evaluate

public void evaluate(VectorizedRowBatch batch)
Description copied from class: VectorExpression
This is the primary method to implement expression logic.

Specified by:
evaluate in class VectorExpression

getOutputColumn

public int getOutputColumn()
Description copied from class: VectorExpression
Returns the index of the output column in the array of column vectors. If not applicable, -1 is returned.

Specified by:
getOutputColumn in class VectorExpression
Returns:
Index of the output column

getOutputType

public String getOutputType()
Description copied from class: VectorExpression
Returns type of the output column.

Overrides:
getOutputType in class VectorExpression

getColNum

public int getColNum()

setColNum

public void setColNum(int colNum)

getPattern

public String getPattern()

setPattern

public void setPattern(String pattern)

getDescriptor

public VectorExpressionDescriptor.Descriptor getDescriptor()
Specified by:
getDescriptor in class VectorExpression


Copyright © 2014 The Apache Software Foundation. All rights reserved.