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

java.lang.Object
  extended by org.apache.hadoop.hive.ql.lib.Utils

public class Utils
extends Object

Contains common utility functions to manipulate nodes, walkers etc.


Constructor Summary
Utils()
           
 
Method Summary
static
<T> T
findNode(Stack<Node> stack, Class<T> target)
          Find the first node of a type from ancestor stack, starting from parents.
static Node getNthAncestor(Stack<Node> st, int n)
          Gets the nth ancestor (the parent being the 1st ancestor) in the traversal path.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Utils

public Utils()
Method Detail

getNthAncestor

public static Node getNthAncestor(Stack<Node> st,
                                  int n)
Gets the nth ancestor (the parent being the 1st ancestor) in the traversal path. n=0 returns the currently visited node.

Parameters:
st - The stack that encodes the traversal path.
n - The value of n (n=0 is the currently visited node).
Returns:
Node The Nth ancestor in the path with respect to the current node.

findNode

public static <T> T findNode(Stack<Node> stack,
                             Class<T> target)
Find the first node of a type from ancestor stack, starting from parents. Returns null if not found.



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