public class RequestedColumnImpl extends BaseRequestedColumn implements QualifierContainer
PathSegment.NameSegment
, except that this
version is an aggregate. If the projection list contains `a.b` and `a.c`,
then one name segment exists for a, and contains segments for both b and c.Constructor and Description |
---|
RequestedColumnImpl(RequestedTuple parent,
String name) |
Modifier and Type | Method and Description |
---|---|
int |
arrayDims()
If
isArray() returns true, reports the number of dimensions
observed in projection. |
protected void |
bumpRefCount() |
boolean |
hasIndex(int index)
Report is a specific index was selected.
|
boolean |
hasIndexes()
Reports if the projection list included (only) specific element
indexes.
|
boolean[] |
indexes()
Return a bitmap of the selected indexes.
|
boolean |
isArray()
Report whether the first qualifier is an array.
|
boolean |
isSimple() |
boolean |
isTuple()
Report whether the projection implies a tuple.
|
boolean |
isWildcard()
Several consumers of this this mechanism process the "raw" projection list
which can contain a combination of wildcard and otehr columns.
|
int |
maxIndex()
Return the maximum index value, if only explicit indexes were given.
|
Qualifier |
qualifier()
The internal qualifier information for the column.
|
int |
refCount() |
Qualifier |
requireQualifier() |
String |
toString()
Convert the projection to a string of the form:
a[0,1,4]['*']{b, c d} . |
RequestedTuple |
tuple()
Return projection information for the column as a tuple.
|
buildName, fullName, isRoot, name, nameEquals
public RequestedColumnImpl(RequestedTuple parent, String name)
protected void bumpRefCount()
public int refCount()
public Qualifier qualifier()
RequestedColumn
qualifier
in interface QualifierContainer
qualifier
in interface RequestedColumn
public Qualifier requireQualifier()
requireQualifier
in interface QualifierContainer
public boolean isWildcard()
RequestedColumn
filename, *, dir0
. The requested tuple preserves the wildcard
within the projection list so that, say, the projection mechanism can insert
the actual data columns between the two implicit columns in the example.
If a column is a wildcard, then none of the other methods apply, since this projected column represents any number or actual columns.
isWildcard
in interface RequestedColumn
public boolean isSimple()
isSimple
in interface RequestedColumn
a
.public boolean isTuple()
RequestedColumn
a.b
. Not that this method, and others can only tell
if the projection implies a tuple; the actual column may
be a tuple (MAP), but be projected simply. The map
format also describes a DICT with a VARCHAR key.isTuple
in interface RequestedColumn
public RequestedTuple tuple()
RequestedColumn
a.b, a.c
, then the tuple projection will list only
the referenced columns. However, if projection is generic
(m
), then we presume all columns of the map are projected
and the returned object assumes all members are projected.tuple
in interface RequestedColumn
public boolean isArray()
RequestedColumn
a[1]
. The array format also describes
a DICT with an integer key.isArray
in interface RequestedColumn
public boolean hasIndexes()
RequestedColumn
a[2], a[5]
. The user could also project
both indexes and the array: a[0], a
. In this case
isArray()
is {code true}, but hasIndexes()
is false
.hasIndexes
in interface RequestedColumn
true
if the column has enumerated indexes, false
if the column was also projected as a whole, or if this column
was not observed to be an arraypublic boolean hasIndex(int index)
RequestedColumn
columns
column where
the user can select specific elements (column) but not others.hasIndex
in interface RequestedColumn
index
- the array index to checktrue
if the array element was projected, either
explicitly (a[3]
) or implicitly (a
). Returns
false
only if hasIndexes()
returns
true
(the user listed only explicit indexes) and the
requested index is not among those requested (index >=
maxIndex() || !indexes()[index]
)public int maxIndex()
RequestedColumn
hasIndexes()
returns true.maxIndex
in interface RequestedColumn
isArray()
is false
. Also returns 0 if
hasIndexe()
returns false
, meaning that either
the column was not observed to be an array, or was projected
with both indexes and by itself: a[0], a
.public boolean[] indexes()
RequestedColumn
hasIndexes()
returns true
.indexes
in interface RequestedColumn
null
if hasIndexes()
returns false
.public String toString()
a[0,1,4]['*']{b, c d}
.
The information here s insufficient to specify a type,
it only specifies a pattern to which types are compatible.public int arrayDims()
RequestedColumn
isArray()
returns true, reports the number of dimensions
observed in projection. That is if projection is a[0][1]
,
then this method returns 2.
Note that, as with all projection-level information, this number reflects only what was in the project list; not what might be the number of dimensions in the actual input source.
arrayDims
in interface RequestedColumn
isArray()
returns false
.Copyright © 1970 The Apache Software Foundation. All rights reserved.