public class ASTNodeOrigin extends Object
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 and Description |
---|
ASTNodeOrigin(String objectType,
String objectName,
String objectDefinition,
String usageAlias,
ASTNode usageNode) |
Modifier and Type | Method and Description |
---|---|
String |
getObjectDefinition() |
String |
getObjectName() |
String |
getObjectType() |
String |
getUsageAlias() |
ASTNode |
getUsageNode() |
public String getObjectType()
public String getObjectName()
public String getObjectDefinition()
select x+1 as y from t
.public String getUsageAlias()
public ASTNode getUsageNode()
v as v1
(this can help with
debugging context-dependent expansions)Copyright © 2017 The Apache Software Foundation. All rights reserved.