Package org.apache.druid.query.groupby
Class ResultRow
java.lang.Object
org.apache.druid.query.groupby.ResultRow
Used by
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.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncopy()Returns a copy of this row.static ResultRowcreate(int size) Create a row of a certain size, initialized to all nulls.booleanstatic ResultRowfromLegacyRow(Row row, GroupByQuery query) Create a row based on a legacyRowthat was generated by a givenGroupByQuery.get(int i) Object[]getArray()Get the backing array for this row (not a copy).longgetLong(int i) inthashCode()intlength()static ResultRowCreate a row from an array of objects.voidtoMap(GroupByQuery query) Returns a Map representation of the data in this row.toMapBasedRow(GroupByQuery query) Returns aRowrepresentation of the data in this row.toString()
-
Method Details
-
of
Create a row from an array of objects. -
create
Create a row of a certain size, initialized to all nulls. -
fromLegacyRow
Create a row based on a legacyRowthat was generated by a givenGroupByQuery. This is useful for deserializing rows that have come off the wire in the older format. (In the past, GroupBy query results were sequences ofRow, not ResultRow.)- Parameters:
row- legacy rowquery- query corresponding to the output ResultRow
-
getArray
Get the backing array for this row (not a copy). -
set
-
get
-
getLong
public long getLong(int i) -
length
public int length() -
copy
Returns a copy of this row. The backing array will be copied as well. -
toMap
Returns a Map representation of the data in this row. Does not include the timestamp. -
toMapBasedRow
Returns aRowrepresentation of the data in this row. -
equals
-
hashCode
public int hashCode() -
toString
-