public class SchemaPath extends LogicalExpressionBase
Modifier and Type | Class and Description |
---|---|
static class |
SchemaPath.De |
LogicalExpression.Se
Modifier and Type | Field and Description |
---|---|
static String |
DYNAMIC_STAR |
static SchemaPath |
STAR_COLUMN |
Constructor and Description |
---|
SchemaPath(PathSegment.NameSegment rootSegment) |
SchemaPath(PathSegment.NameSegment rootSegment,
ExpressionPosition pos) |
SchemaPath(SchemaPath path) |
SchemaPath(String simpleName,
ExpressionPosition pos)
Deprecated.
Use
#SchemaPath(NameSegment)
or #SchemaPath(NameSegment, ExpressionPosition) instead |
Modifier and Type | Method and Description |
---|---|
<T,V,E extends Exception> |
accept(ExprVisitor<T,V,E> visitor,
V value) |
boolean |
contains(SchemaPath path) |
static SchemaPath |
create(UserBitShared.NamePart namePart) |
boolean |
equals(Object obj) |
UserBitShared.NamePart |
getAsNamePart() |
String |
getAsUnescapedPath() |
SchemaPath |
getChild(int index) |
SchemaPath |
getChild(int index,
Object originalValue,
TypeProtos.MajorType valueType) |
SchemaPath |
getChild(String childPath) |
SchemaPath |
getChild(String childPath,
Object originalValue,
TypeProtos.MajorType valueType) |
static SchemaPath |
getCompoundPath(int n,
String... path)
Constructs
SchemaPath based on given path array up to nth element (inclusively). |
static SchemaPath |
getCompoundPath(String... path) |
PathSegment |
getLastSegment() |
TypeProtos.MajorType |
getMajorType() |
PathSegment.NameSegment |
getRootSegment() |
String |
getRootSegmentPath()
Returns path string of
rootSegment |
static SchemaPath |
getSimplePath(String name) |
SchemaPath |
getUnIndexed()
Returns schema path with for arrays without index.
|
int |
hashCode() |
boolean |
isArray()
Return whether this name refers to an array.
|
boolean |
isDynamicStar()
Return if this column is the special wildcard ("**") column which means to
project all table columns.
|
boolean |
isLeaf()
Determine if this is a one-part name.
|
boolean |
isSimplePath()
A simple is a path where there are no repeated elements outside the lowest level of the path.
|
Iterator<LogicalExpression> |
iterator() |
boolean |
nameEquals(String name)
Returns if this is a simple column and the name matches the given
name (ignoring case.) This does not check if the name is an entire
match, only the the first (or only) part of the name matches.
|
static SchemaPath |
parseFromString(String expr)
Parses input string using the same rules which are used for the field in the query.
|
String |
rootName()
Return the root name: either the entire name (if one part) or
the first part (if multi-part.)
a: returns a
a.b: returns a
a[10]: returns a
|
String |
toExpr() |
String |
toString() |
getCumulativeCost, getDescription, getPosition, getSelfCost, i
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public static final String DYNAMIC_STAR
public static final SchemaPath STAR_COLUMN
public SchemaPath(SchemaPath path)
public SchemaPath(PathSegment.NameSegment rootSegment)
@Deprecated public SchemaPath(String simpleName, ExpressionPosition pos)
#SchemaPath(NameSegment)
or #SchemaPath(NameSegment, ExpressionPosition)
insteadpublic SchemaPath(PathSegment.NameSegment rootSegment, ExpressionPosition pos)
public static SchemaPath getSimplePath(String name)
public static SchemaPath getCompoundPath(String... path)
public static SchemaPath getCompoundPath(int n, String... path)
SchemaPath
based on given path
array up to nth element (inclusively).
Example: for case when n = 2
and path = {"a", "b", "c", "d", "e", ...}
the method returns a.b
n
- number of elements in path array to take when constructing SchemaPath
path
- column path used to construct schema pathpublic PathSegment getLastSegment()
public UserBitShared.NamePart getAsNamePart()
public static SchemaPath create(UserBitShared.NamePart namePart)
public SchemaPath getUnIndexed()
public static SchemaPath parseFromString(String expr)
SchemaPath
with the PathSegment.NameSegment
which contains one else PathSegment.NameSegment
, etc.
If a string contains [] then PathSegment.ArraySegment
will be created.expr
- input string to be parsedSchemaPath
instancepublic boolean isSimplePath()
public boolean isArray()
public boolean isLeaf()
public boolean isDynamicStar()
public boolean nameEquals(String name)
isLeaf()
to check for a single-part name.name
- name to matchpublic String rootName()
public <T,V,E extends Exception> T accept(ExprVisitor<T,V,E> visitor, V value) throws E extends Exception
E extends Exception
public SchemaPath getChild(String childPath)
public SchemaPath getChild(String childPath, Object originalValue, TypeProtos.MajorType valueType)
public SchemaPath getChild(int index)
public SchemaPath getChild(int index, Object originalValue, TypeProtos.MajorType valueType)
public PathSegment.NameSegment getRootSegment()
public String getAsUnescapedPath()
public TypeProtos.MajorType getMajorType()
getMajorType
in interface LogicalExpression
getMajorType
in class LogicalExpressionBase
public boolean contains(SchemaPath path)
public Iterator<LogicalExpression> iterator()
public String toExpr()
public String getRootSegmentPath()
rootSegment
rootSegment
Copyright © 1970 The Apache Software Foundation. All rights reserved.