org.apache.hadoop.hive.ql.lib
Class RuleRegExp

java.lang.Object
  extended by org.apache.hadoop.hive.ql.lib.RuleRegExp
All Implemented Interfaces:
Rule

public class RuleRegExp
extends Object
implements Rule

Rule interface for Nodes Used in Node dispatching to dispatch process/visitor functions for Nodes.


Constructor Summary
RuleRegExp(String ruleName, String regExp)
          The rule specified by the regular expression.
 
Method Summary
 int cost(Stack<Node> stack)
          This function returns the cost of the rule for the specified stack.
 String getName()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuleRegExp

public RuleRegExp(String ruleName,
                  String regExp)
The rule specified by the regular expression. Note that, the regular expression is specified in terms of Node name. For eg: TS.*RS -> means TableScan Node followed by anything any number of times followed by ReduceSink

Parameters:
ruleName - name of the rule
regExp - regular expression for the rule
Method Detail

cost

public int cost(Stack<Node> stack)
         throws SemanticException
This function returns the cost of the rule for the specified stack. Lower the cost, the better the rule is matched

Specified by:
cost in interface Rule
Parameters:
stack - Node stack encountered so far
Returns:
cost of the function
Throws:
SemanticException

getName

public String getName()
Specified by:
getName in interface Rule
Returns:
the name of the Node


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