Package io.confluent.ksql.api.client
Interface Row
public interface Row
A single record, returned as part of a query result.
-
Method Summary
Modifier and TypeMethodDescriptionasObject()Returns the data in this row represented as aKsqlObjectwhere keys are column names and values are column values.Returns column names for the data in this row.Returns column types for the data in this row.getBoolean(int columnIndex) Returns the value for a particular column of theRowas a boolean.getBoolean(String columnName) Returns the value for a particular column of theRowas a boolean.byte[]getBytes(int columnIndex) Returns the value for a particular column of theRowas a byte array.byte[]Returns the value for a particular column of theRowas byte array.getDecimal(int columnIndex) Returns the value for a particular column of theRowas aBigDecimal.getDecimal(String columnName) Returns the value for a particular column of theRowas aBigDecimal.getDouble(int columnIndex) Returns the value for a particular column of theRowas a double.Returns the value for a particular column of theRowas a double.getInteger(int columnIndex) Returns the value for a particular column of theRowas an integer.getInteger(String columnName) Returns the value for a particular column of theRowas an integer.getKsqlArray(int columnIndex) Returns the value for a particular column of theRowas aKsqlArray.getKsqlArray(String columnName) Returns the value for a particular column of theRowas aKsqlArray.getKsqlObject(int columnIndex) Returns the value for a particular column of theRowas aKsqlObject.getKsqlObject(String columnName) Returns the value for a particular column of theRowas aKsqlObject.getLong(int columnIndex) Returns the value for a particular column of theRowas a long.Returns the value for a particular column of theRowas a long.getString(int columnIndex) Returns the value for a particular column of theRowas a string.Returns the value for a particular column of theRowas a string.getValue(int columnIndex) Returns the value for a particular column of theRowas anObject.Returns the value for a particular column of theRowas anObject.booleanisNull(int columnIndex) Returns whether the value for a particular column of theRowis null.booleanReturns whether the value for a particular column of theRowis null.values()Returns the values (data) in this row, represented as aKsqlArray.
-
Method Details
-
columnNames
Returns column names for the data in this row.- Returns:
- the column names
-
columnTypes
List<ColumnType> columnTypes()Returns column types for the data in this row.- Returns:
- the column types
-
values
KsqlArray values()Returns the values (data) in this row, represented as aKsqlArray.Returned values are JSON types which means numeric columns are not necessarily typed in accordance with
columnTypes(). For example, aBIGINTfield will be typed as an integer rather than a long, if the numeric value fits into an integer.- Returns:
- the values
-
asObject
KsqlObject asObject()Returns the data in this row represented as aKsqlObjectwhere keys are column names and values are column values.- Returns:
- the data
-
isNull
boolean isNull(int columnIndex) Returns whether the value for a particular column of theRowis null.- Parameters:
columnIndex- index of column (1-indexed)- Returns:
- whether the column value is null
- Throws:
IndexOutOfBoundsException- if the index is invalid
-
isNull
Returns whether the value for a particular column of theRowis null.- Parameters:
columnName- name of column- Returns:
- whether the column value is null
- Throws:
IllegalArgumentException- if the column name is invalid
-
getValue
Returns the value for a particular column of theRowas anObject.- Parameters:
columnIndex- index of column (1-indexed)- Returns:
- column value
- Throws:
IndexOutOfBoundsException- if the index is invalid
-
getValue
Returns the value for a particular column of theRowas anObject.- Parameters:
columnName- name of column- Returns:
- column value
- Throws:
IllegalArgumentException- if the column name is invalid
-
getString
Returns the value for a particular column of theRowas a string.- Parameters:
columnIndex- index of column (1-indexed)- Returns:
- column value
- Throws:
ClassCastException- if the column value is not a stringIndexOutOfBoundsException- if the index is invalid
-
getString
Returns the value for a particular column of theRowas a string.- Parameters:
columnName- name of column- Returns:
- column value
- Throws:
ClassCastException- if the column value is not a stringIllegalArgumentException- if the column name is invalid
-
getInteger
Returns the value for a particular column of theRowas an integer.- Parameters:
columnIndex- index of column (1-indexed)- Returns:
- column value
- Throws:
ClassCastException- if the column value is not aNumberIndexOutOfBoundsException- if the index is invalid
-
getInteger
Returns the value for a particular column of theRowas an integer.- Parameters:
columnName- name of column- Returns:
- column value
- Throws:
ClassCastException- if the column value is not aNumberIllegalArgumentException- if the column name is invalid
-
getLong
Returns the value for a particular column of theRowas a long.- Parameters:
columnIndex- index of column (1-indexed)- Returns:
- column value
- Throws:
ClassCastException- if the column value is not aNumberIndexOutOfBoundsException- if the index is invalid
-
getLong
Returns the value for a particular column of theRowas a long.- Parameters:
columnName- name of column- Returns:
- column value
- Throws:
ClassCastException- if the column value is not aNumberIllegalArgumentException- if the column name is invalid
-
getDouble
Returns the value for a particular column of theRowas a double.- Parameters:
columnIndex- index of column (1-indexed)- Returns:
- column value
- Throws:
ClassCastException- if the column value is not aNumberIndexOutOfBoundsException- if the index is invalid
-
getDouble
Returns the value for a particular column of theRowas a double.- Parameters:
columnName- name of column- Returns:
- column value
- Throws:
ClassCastException- if the column value is not aNumberIllegalArgumentException- if the column name is invalid
-
getBoolean
Returns the value for a particular column of theRowas a boolean.- Parameters:
columnIndex- index of column (1-indexed)- Returns:
- column value
- Throws:
ClassCastException- if the column value is not a booleanIndexOutOfBoundsException- if the index is invalid
-
getBoolean
Returns the value for a particular column of theRowas a boolean.- Parameters:
columnName- name of column- Returns:
- column value
- Throws:
ClassCastException- if the column value is not a booleanIllegalArgumentException- if the column name is invalid
-
getDecimal
Returns the value for a particular column of theRowas aBigDecimal.- Parameters:
columnIndex- index of column (1-indexed)- Returns:
- column value
- Throws:
ClassCastException- if the column value is not aNumberIndexOutOfBoundsException- if the index is invalid
-
getDecimal
Returns the value for a particular column of theRowas aBigDecimal.- Parameters:
columnName- name of column- Returns:
- column value
- Throws:
ClassCastException- if the column value is not aNumberIllegalArgumentException- if the column name is invalid
-
getBytes
byte[] getBytes(int columnIndex) Returns the value for a particular column of theRowas a byte array.- Parameters:
columnIndex- index of column (1-indexed)- Returns:
- column value
- Throws:
ClassCastException- if the column value is not aStringIllegalArgumentException- if the column value is not a base64 encoded stringIndexOutOfBoundsException- if the index is invalid
-
getBytes
Returns the value for a particular column of theRowas byte array.- Parameters:
columnName- name of column- Returns:
- column value
- Throws:
ClassCastException- if the column value is not aStringIllegalArgumentException- if the column name is invalid or the column value is not a base64 encoded string
-
getKsqlObject
Returns the value for a particular column of theRowas aKsqlObject. Useful forMAPandSTRUCTcolumn types.- Parameters:
columnIndex- index of column (1-indexed)- Returns:
- column value
- Throws:
ClassCastException- if the column value cannot be converted to a mapIndexOutOfBoundsException- if the index is invalid
-
getKsqlObject
Returns the value for a particular column of theRowas aKsqlObject. Useful forMAPandSTRUCTcolumn types.- Parameters:
columnName- name of column- Returns:
- column value
- Throws:
ClassCastException- if the column value cannot be converted to a mapIllegalArgumentException- if the column name is invalid
-
getKsqlArray
- Parameters:
columnIndex- index of column (1-indexed)- Returns:
- column value
- Throws:
ClassCastException- if the column value cannot be converted to a listIndexOutOfBoundsException- if the index is invalid
-
getKsqlArray
- Parameters:
columnName- name of column- Returns:
- column value
- Throws:
ClassCastException- if the column value cannot be converted to a listIllegalArgumentException- if the column name is invalid
-