public final class ResultRow extends Object
GroupByQuery
for results. Each row is positional, and has the following fields, in order:
- Timestamp (optional; only if granularity != ALL)
- Dimensions (in order)
- Aggregators (in order)
- Post-aggregators (optional; in order, if present)
ResultRows may sometimes be created without space reserved for post-aggregators, in contexts where it is known
that post-aggregators will not be computed.GroupByQuery.getResultRowSignature()
,
GroupByQuery.getResultRowHasTimestamp()
,
GroupByQuery.getUniversalTimestamp()
,
GroupByQuery.getResultRowDimensionStart()
,
GroupByQuery.getResultRowAggregatorStart()
,
GroupByQuery.getResultRowPostAggregatorStart()
,
GroupByQuery.getResultRowSizeWithPostAggregators()
,
GroupByQuery.getResultRowSizeWithoutPostAggregators()
Modifier and Type | Method and Description |
---|---|
ResultRow |
copy()
Returns a copy of this row.
|
static ResultRow |
create(int size)
Create a row of a certain size, initialized to all nulls.
|
boolean |
equals(Object o) |
static ResultRow |
fromLegacyRow(Row row,
GroupByQuery query)
Create a row based on a legacy
Row that was generated by a given GroupByQuery . |
Object |
get(int i) |
Object[] |
getArray()
Get the backing array for this row (not a copy).
|
long |
getLong(int i) |
int |
hashCode() |
int |
length() |
static ResultRow |
of(Object... row)
Create a row from an array of objects.
|
void |
set(int i,
Object o) |
Map<String,Object> |
toMap(GroupByQuery query)
Returns a Map representation of the data in this row.
|
MapBasedRow |
toMapBasedRow(GroupByQuery query)
Returns a
Row representation of the data in this row. |
String |
toString() |
public static ResultRow create(int size)
public static ResultRow fromLegacyRow(Row row, GroupByQuery query)
Row
that was generated by a given GroupByQuery
. This is useful
for deserializing rows that have come off the wire in the older format. (In the past, GroupBy query results
were sequences of Row
, not ResultRow.)row
- legacy rowquery
- query corresponding to the output ResultRowpublic Object[] getArray()
public long getLong(int i)
public int length()
public ResultRow copy()
public Map<String,Object> toMap(GroupByQuery query)
public MapBasedRow toMapBasedRow(GroupByQuery query)
Row
representation of the data in this row.Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.