Package org.apache.druid.data.input
Interface Row
-
- All Superinterfaces:
Comparable<Row>
- All Known Subinterfaces:
InputRow
- All Known Implementing Classes:
MapBasedInputRow
,MapBasedRow
,Transformer.TransformedInputRow
public interface Row extends Comparable<Row>
A Row of data. This can be used for both input and output into various parts of the system. It assumes that the user already knows the schema of the row and can query for the parts that they care about.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<String>
getDimension(String dimension)
Returns the list of dimension values for the given column name.Number
getMetric(String metric)
Returns the metric column value for the given column name.Object
getRaw(String dimension)
Returns the raw dimension value for the given column name.org.joda.time.DateTime
getTimestamp()
Returns the timestamp from the epoch as an org.joda.time.DateTime.long
getTimestampFromEpoch()
Returns the timestamp from the epoch in milliseconds.-
Methods inherited from interface java.lang.Comparable
compareTo
-
-
-
-
Method Detail
-
getTimestampFromEpoch
long getTimestampFromEpoch()
Returns the timestamp from the epoch in milliseconds. If the event happened _right now_, this would return the same thing as System.currentTimeMillis();- Returns:
- the timestamp from the epoch in milliseconds.
-
getTimestamp
org.joda.time.DateTime getTimestamp()
Returns the timestamp from the epoch as an org.joda.time.DateTime. If the event happened _right now_, this would return the same thing as new DateTime();- Returns:
- the timestamp from the epoch as an org.joda.time.DateTime object.
-
getDimension
List<String> getDimension(String dimension)
Returns the list of dimension values for the given column name.- Parameters:
dimension
- the column name of the dimension requested- Returns:
- the list of values for the provided column name
-
getRaw
@Nullable Object getRaw(String dimension)
Returns the raw dimension value for the given column name. This is different fromgetDimension(java.lang.String)
which converts all values to strings before returning them.- Parameters:
dimension
- the column name of the dimension requested- Returns:
- the value of the provided column name
-
getMetric
@Nullable Number getMetric(String metric)
Returns the metric column value for the given column name. This method is different fromgetRaw(java.lang.String)
in two aspects: 1. If the column is absent in the row, either numeric zero or null will be returned, depending on the value of druid.generic.useDefaultValueForNull. 2. If the column has string value, an attempt is made to parse this value as a number.
-
-