org.apache.hadoop.hive.ql.parse
Class ASTNodeOrigin

java.lang.Object
  extended by org.apache.hadoop.hive.ql.parse.ASTNodeOrigin

public class ASTNodeOrigin
extends Object

ASTNodeOrigin contains contextual information about the object from whose definition a particular ASTNode originated. For example, suppose a view v is defined as select x+1 as y from t, and we're processing a query select v1.y from v as v1, and there's a type-checking problem with the expression x+1 due to an ALTER TABLE on t subsequent to the creation of v. Then, when reporting the error, we want to provide the parser location with respect to the definition of v (rather than with respect to the top-level query, since that represents a completely different "parser coordinate system").

So, when expanding the definition of v while analyzing the top-level query, we tag each ASTNode with a reference to an ASTNodeOrign describing v and its usage within the query.


Constructor Summary
ASTNodeOrigin(String objectType, String objectName, String objectDefinition, String usageAlias, ASTNode usageNode)
           
 
Method Summary
 String getObjectDefinition()
           
 String getObjectName()
           
 String getObjectType()
           
 String getUsageAlias()
           
 ASTNode getUsageNode()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ASTNodeOrigin

public ASTNodeOrigin(String objectType,
                     String objectName,
                     String objectDefinition,
                     String usageAlias,
                     ASTNode usageNode)
Method Detail

getObjectType

public String getObjectType()
Returns:
the type of the object from which an ASTNode originated, e.g. "view".

getObjectName

public String getObjectName()
Returns:
the name of the object from which an ASTNode originated, e.g. "v".

getObjectDefinition

public String getObjectDefinition()
Returns:
the definition of the object from which an ASTNode originated, e.g. select x+1 as y from t.

getUsageAlias

public String getUsageAlias()
Returns:
the alias of the object from which an ASTNode originated, e.g. "v1" (this can help with debugging context-dependent expansions)

getUsageNode

public ASTNode getUsageNode()
Returns:
the expression node triggering usage of an object from which an ASTNode originated, e.g. v as v1 (this can help with debugging context-dependent expansions)


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