org.apache.hadoop.hive.metastore.parser
Class ExpressionTree

java.lang.Object
  extended by org.apache.hadoop.hive.metastore.parser.ExpressionTree

public class ExpressionTree
extends Object

The Class representing the filter as a binary tree. The tree has TreeNode's at intermediate level and the leaf level nodes are of type LeafNode.


Nested Class Summary
static class ExpressionTree.ANTLRNoCaseStringStream
          Case insensitive ANTLR string stream
static class ExpressionTree.LeafNode
          The Class representing the leaf level nodes in the ExpressionTree.
static class ExpressionTree.LogicalOperator
          The logical operations supported.
static class ExpressionTree.Operator
          The operators supported.
static class ExpressionTree.TreeNode
          The Class representing a Node in the ExpressionTree.
 
Constructor Summary
ExpressionTree()
           
 
Method Summary
 void addIntermediateNode(ExpressionTree.LogicalOperator andOr)
          Adds a intermediate node of either type(AND/OR).
 void addLeafNode(ExpressionTree.LeafNode newNode)
          Adds a leaf node, pushes the new node onto the stack.
 String generateJDOFilter(Table table, Map<String,String> params)
          Generate the JDOQL filter for the given expression tree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionTree

public ExpressionTree()
Method Detail

addIntermediateNode

public void addIntermediateNode(ExpressionTree.LogicalOperator andOr)
Adds a intermediate node of either type(AND/OR). Pops last two nodes from the stack and sets them as children of the new node and pushes itself onto the stack.

Parameters:
andOr - the operator type

addLeafNode

public void addLeafNode(ExpressionTree.LeafNode newNode)
Adds a leaf node, pushes the new node onto the stack.

Parameters:
newNode - the new node

generateJDOFilter

public String generateJDOFilter(Table table,
                                Map<String,String> params)
                         throws MetaException
Generate the JDOQL filter for the given expression tree

Parameters:
table - the table being queried
params - the input map which is updated with the the parameterized values. Keys are the parameter names and values are the parameter values
Returns:
the string representation of the expression tree
Throws:
MetaException


Copyright © 2011 The Apache Software Foundation