Interface ClickHouseBinaryFormatReader
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
AbstractBinaryFormatReader,NativeFormatReader,RowBinaryFormatReader,RowBinaryWithNamesAndTypesFormatReader,RowBinaryWithNamesFormatReader
-
Method Summary
Modifier and TypeMethodDescriptiongetBigDecimal(int index) Reads column with name `colName` as a BigDecimal.getBigDecimal(String colName) Reads column with name `colName` as a BigDecimal.getBigInteger(int index) Reads column with name `colName` as a BigInteger.getBigInteger(String colName) Reads column with name `colName` as a BigInteger.booleangetBoolean(int index) Reads column with name `colName` as a boolean.booleangetBoolean(String colName) Reads column with name `colName` as a boolean.boolean[]getBooleanArray(int index) Returns the value of the specified column as aboolean[].boolean[]getBooleanArray(String colName) bytegetByte(int index) Reads column with name `colName` as a byte.byteReads column with name `colName` as a byte.byte[]getByteArray(int index) Returns the value of the specified column as abyte[].byte[]getByteArray(String colName) getClickHouseBitmap(int index) getClickHouseBitmap(String colName) doublegetDouble(int index) Reads column with name `colName` as a double.doubleReads column with name `colName` as a double.double[]getDoubleArray(int index) Returns the value of the specified column as adouble[].double[]getDoubleArray(String colName) getDuration(int index) Returns the value of the specified column as a Duration.getDuration(String colName) Returns the value of the specified column as a Duration.shortgetEnum16(int index) shortbytegetEnum8(int index) bytefloatgetFloat(int index) Reads column with name `colName` as a float.floatReads column with name `colName` as a float.float[]getFloatArray(int index) Returns the value of the specified column as afloat[].float[]getFloatArray(String colName) getGeoMultiPolygon(int index) Returns the value of the specified column as a ClickHouseGeoMultiPolygonValue.getGeoMultiPolygon(String colName) Returns the value of the specified column as a ClickHouseGeoMultiPolygonValue.getGeoPoint(int index) Returns the value of the specified column as a ClickHouseGeoPointValue.getGeoPoint(String colName) Returns the value of the specified column as a ClickHouseGeoPointValue.getGeoPolygon(int index) Returns the value of the specified column as a ClickHouseGeoPolygonValue.getGeoPolygon(String colName) Returns the value of the specified column as a ClickHouseGeoPolygonValue.getGeoRing(int index) Returns the value of the specified column as a ClickHouseGeoRingValue.getGeoRing(String colName) Returns the value of the specified column as a ClickHouseGeoRingValue.getInet4Address(int index) Returns the value of the specified column as an Inet4Address.getInet4Address(String colName) Returns the value of the specified column as an Inet4Address.getInet6Address(int index) Returns the value of the specified column as an Inet6Address.getInet6Address(String colName) Returns the value of the specified column as an Inet6Address.getInstant(int index) Returns the value of the specified column as an Instant.getInstant(String colName) Returns the value of the specified column as an Instant.int[]getIntArray(int index) Returns the value of the specified column as anint[].int[]getIntArray(String colName) intgetInteger(int index) Reads column with name `colName` as an integer.intgetInteger(String colName) Reads column with name `colName` as an integer.<T> List<T>getList(int index) Returns the value of the specified column as aList.<T> List<T>getLocalDate(int index) getLocalDate(String colName) getLocalDateTime(int index) getLocalDateTime(String colName) getLocalTime(int index) getLocalTime(String colName) longgetLong(int index) Reads column with name `colName` as a long.longReads column with name `colName` as a long.long[]getLongArray(int index) Returns the value of the specified column as along[].long[]getLongArray(String colName) Object[]getObjectArray(int index) Returns the value of the specified column as anObject[].Object[]getObjectArray(String colName) getOffsetDateTime(int index) getOffsetDateTime(String colName) shortgetShort(int index) Reads column with name `colName` as a short.shortReads column with name `colName` as a short.short[]getShortArray(int index) Returns the value of the specified column as ashort[].short[]getShortArray(String colName) getString(int index) Reads column with name `colName` as a string.Reads column with name `colName` as a string.String[]getStringArray(int index) Returns the value of the specified column as aString[].String[]getStringArray(String colName) getTemporalAmount(int index) getTemporalAmount(String colName) Object[]getTuple(int index) Object[]getUUID(int index) Returns the value of the specified column as a UUID.Returns the value of the specified column as a UUID.getZonedDateTime(int index) Returns the value of the specified column as a ZonedDateTime.getZonedDateTime(String colName) Returns the value of the specified column as a ZonedDateTime.booleanhasNext()Checks if there are more rows to read.booleanhasValue(int colIndex) booleannext()Moves cursor to the next row.<T> TreadValue(int colIndex) Reads a single value from the stream.<T> TReads a row to an array of objects.Methods inherited from interface java.lang.AutoCloseable
close
-
Method Details
-
readValue
<T> T readValue(int colIndex) Reads a single value from the stream.- Type Parameters:
T-- Returns:
-
readValue
Reads a row to an array of objects.- Type Parameters:
T-- Parameters:
colName-- Returns:
-
hasValue
-
hasValue
boolean hasValue(int colIndex) -
hasNext
boolean hasNext()Checks if there are more rows to read.- Returns:
-
next
Moves cursor to the next row. Must be called before reading the first row. Returns reference to an internal record representation. It means that next call to the method will affect value in returned Map. This is done for memory usage optimization. Method is intended to be used only by the client not an application.- Returns:
- reference to a map filled with column values or null if no more records are available
-
getString
Reads column with name `colName` as a string.- Parameters:
colName- - column name- Returns:
-
getByte
Reads column with name `colName` as a byte.- Parameters:
colName- - column name- Returns:
-
getShort
Reads column with name `colName` as a short.- Parameters:
colName- - column name- Returns:
-
getInteger
Reads column with name `colName` as an integer.- Parameters:
colName- - column name- Returns:
-
getLong
Reads column with name `colName` as a long.- Parameters:
colName- - column name- Returns:
-
getFloat
Reads column with name `colName` as a float. Warning: this method may lose precision for float values.- Parameters:
colName-- Returns:
-
getDouble
Reads column with name `colName` as a double. Warning: this method may lose precision for double values.- Parameters:
colName-- Returns:
-
getBoolean
Reads column with name `colName` as a boolean.- Parameters:
colName-- Returns:
-
getBigInteger
Reads column with name `colName` as a BigInteger.- Parameters:
colName-- Returns:
-
getBigDecimal
Reads column with name `colName` as a BigDecimal.- Parameters:
colName-- Returns:
-
getInstant
Returns the value of the specified column as an Instant. Timezone is derived from the column definition. If no timezone is specified in the column definition then UTC will be used. If column value is Date or Date32 it will return an Instant with time set to 00:00:00. If column value is DateTime or DateTime32 it will return an Instant with the time part.- Parameters:
colName-- Returns:
-
getZonedDateTime
Returns the value of the specified column as a ZonedDateTime. Timezone is derived from the column definition. If no timezone is specified in the column definition then UTC will be used. If column value is Date or Date32 it will return a ZonedDateTime with time set to 00:00:00. If column value is DateTime or DateTime32 it will return a ZonedDateTime with the time part.- Parameters:
colName-- Returns:
-
getDuration
Returns the value of the specified column as a Duration. If a stored value is bigger than Long.MAX_VALUE then exception will be thrown. In such case use asBigInteger() method. If value of IntervalQuarter then Duration will be in the unit of Months.- Parameters:
colName-- Returns:
- Duration in the unit of column type.
-
getInet4Address
Returns the value of the specified column as an Inet4Address.- Parameters:
colName-- Returns:
-
getInet6Address
Returns the value of the specified column as an Inet6Address.- Parameters:
colName-- Returns:
-
getUUID
Returns the value of the specified column as a UUID.- Parameters:
colName-- Returns:
-
getGeoPoint
Returns the value of the specified column as a ClickHouseGeoPointValue.- Parameters:
colName-- Returns:
-
getGeoRing
Returns the value of the specified column as a ClickHouseGeoRingValue.- Parameters:
colName-- Returns:
-
getGeoPolygon
Returns the value of the specified column as a ClickHouseGeoPolygonValue.- Parameters:
colName-- Returns:
-
getGeoMultiPolygon
Returns the value of the specified column as a ClickHouseGeoMultiPolygonValue.- Parameters:
colName-- Returns:
-
getList
- Parameters:
colName- - column name- Returns:
- list of values, or
nullif the value is null - See Also:
-
getByteArray
- Parameters:
colName- - column name- Returns:
- array of bytes, or
nullif the value is null - See Also:
-
getIntArray
- Parameters:
colName- - column name- Returns:
- array of int values, or
nullif the value is null - See Also:
-
getLongArray
- Parameters:
colName- - column name- Returns:
- array of long values, or
nullif the value is null - See Also:
-
getFloatArray
- Parameters:
colName- - column name- Returns:
- array of float values, or
nullif the value is null - See Also:
-
getDoubleArray
- Parameters:
colName- - column name- Returns:
- array of double values, or
nullif the value is null - See Also:
-
getBooleanArray
- Parameters:
colName- - column name- Returns:
- array of boolean values, or
nullif the value is null - See Also:
-
getShortArray
- Parameters:
colName- - column name- Returns:
- array of short values, or
nullif the value is null - See Also:
-
getStringArray
- Parameters:
colName- - column name- Returns:
- array of string values, or
nullif the value is null - See Also:
-
getObjectArray
- Parameters:
colName- - column name- Returns:
- array of objects, or
nullif the value is null - See Also:
-
getString
Reads column with name `colName` as a string.- Parameters:
index-- Returns:
-
getByte
byte getByte(int index) Reads column with name `colName` as a byte.- Parameters:
index-- Returns:
-
getShort
short getShort(int index) Reads column with name `colName` as a short.- Parameters:
index-- Returns:
-
getInteger
int getInteger(int index) Reads column with name `colName` as an integer.- Parameters:
index-- Returns:
-
getLong
long getLong(int index) Reads column with name `colName` as a long.- Parameters:
index-- Returns:
-
getFloat
float getFloat(int index) Reads column with name `colName` as a float. Warning: this method may lose precision for float values.- Parameters:
index-- Returns:
-
getDouble
double getDouble(int index) Reads column with name `colName` as a double. Warning: this method may lose precision for double values.- Parameters:
index-- Returns:
-
getBoolean
boolean getBoolean(int index) Reads column with name `colName` as a boolean.- Parameters:
index-- Returns:
-
getBigInteger
Reads column with name `colName` as a BigInteger.- Parameters:
index-- Returns:
-
getBigDecimal
Reads column with name `colName` as a BigDecimal.- Parameters:
index-- Returns:
-
getInstant
Returns the value of the specified column as an Instant. Timezone is derived from the column definition. If no timezone is specified in the column definition then UTC will be used. If column value is Date or Date32 it will return an Instant with time set to 00:00:00. If column value is DateTime or DateTime32 it will return an Instant with the time part.- Parameters:
index-- Returns:
-
getZonedDateTime
Returns the value of the specified column as a ZonedDateTime. Timezone is derived from the column definition. If no timezone is specified in the column definition then UTC will be used. If column value is Date or Date32 it will return a ZonedDateTime with time set to 00:00:00. If column value is DateTime or DateTime32 it will return a ZonedDateTime with the time part.- Parameters:
index-- Returns:
-
getDuration
Returns the value of the specified column as a Duration. If a stored value is bigger than Long.MAX_VALUE then exception will be thrown. In such case use asBigInteger() method. If value of IntervalQuarter then Duration will be in the unit of Months.- Parameters:
index-- Returns:
- Duration in the unit of column type.
-
getInet4Address
Returns the value of the specified column as an Inet4Address.- Parameters:
index-- Returns:
-
getInet6Address
Returns the value of the specified column as an Inet6Address.- Parameters:
index-- Returns:
-
getUUID
Returns the value of the specified column as a UUID.- Parameters:
index-- Returns:
-
getGeoPoint
Returns the value of the specified column as a ClickHouseGeoPointValue.- Parameters:
index-- Returns:
-
getGeoRing
Returns the value of the specified column as a ClickHouseGeoRingValue.- Parameters:
index-- Returns:
-
getGeoPolygon
Returns the value of the specified column as a ClickHouseGeoPolygonValue.- Parameters:
index-- Returns:
-
getGeoMultiPolygon
Returns the value of the specified column as a ClickHouseGeoMultiPolygonValue.- Parameters:
index-- Returns:
-
getList
Returns the value of the specified column as aList. Suitable for reading Array columns of any type.For nested arrays (e.g.
Array(Array(Int64))), returns aList<List<Long>>. For nullable arrays (e.g.Array(Nullable(Int32))), list elements may benull.- Parameters:
index- - column index (1-based)- Returns:
- list of values, or
nullif the value is null - Throws:
ClientException- if the column is not an array type
-
getByteArray
byte[] getByteArray(int index) Returns the value of the specified column as abyte[]. Suitable for 1D Array columns only.- Parameters:
index- - column index (1-based)- Returns:
- array of bytes, or
nullif the value is null - Throws:
ClientException- if the value cannot be converted to a byte array
-
getIntArray
int[] getIntArray(int index) Returns the value of the specified column as anint[]. Suitable for 1D Array columns only.- Parameters:
index- - column index (1-based)- Returns:
- array of int values, or
nullif the value is null - Throws:
ClientException- if the value cannot be converted to an int array
-
getLongArray
long[] getLongArray(int index) Returns the value of the specified column as along[]. Suitable for 1D Array columns only.- Parameters:
index- - column index (1-based)- Returns:
- array of long values, or
nullif the value is null - Throws:
ClientException- if the value cannot be converted to a long array
-
getFloatArray
float[] getFloatArray(int index) Returns the value of the specified column as afloat[]. Suitable for 1D Array columns only.- Parameters:
index- - column index (1-based)- Returns:
- array of float values, or
nullif the value is null - Throws:
ClientException- if the value cannot be converted to a float array
-
getDoubleArray
double[] getDoubleArray(int index) Returns the value of the specified column as adouble[]. Suitable for 1D Array columns only.- Parameters:
index- - column index (1-based)- Returns:
- array of double values, or
nullif the value is null - Throws:
ClientException- if the value cannot be converted to a double array
-
getBooleanArray
boolean[] getBooleanArray(int index) Returns the value of the specified column as aboolean[]. Suitable for 1D Array columns only.- Parameters:
index- - column index (1-based)- Returns:
- array of boolean values, or
nullif the value is null - Throws:
ClientException- if the value cannot be converted to a boolean array
-
getShortArray
short[] getShortArray(int index) Returns the value of the specified column as ashort[]. Suitable for 1D Array columns only.- Parameters:
index- - column index (1-based)- Returns:
- array of short values, or
nullif the value is null - Throws:
ClientException- if the value cannot be converted to a short array
-
getStringArray
Returns the value of the specified column as aString[]. Suitable for 1D Array columns only. Cannot be used for none string element types.- Parameters:
index- - column index (1-based)- Returns:
- array of string values, or
nullif the value is null - Throws:
ClientException- if the column is not an array type
-
getObjectArray
Returns the value of the specified column as anObject[]. Suitable for multidimensional Array columns. Nested arrays are recursively converted toObject[]. Note: result is not cached so avoid repetitive calls on same column.- Parameters:
index- - column index (1-based)- Returns:
- array of objects, or
nullif the value is null - Throws:
ClientException- if the column is not an array type
-
getTuple
-
getTuple
-
getEnum8
-
getEnum8
byte getEnum8(int index) -
getEnum16
-
getEnum16
short getEnum16(int index) -
getLocalDate
-
getLocalDate
-
getLocalTime
-
getLocalTime
-
getLocalDateTime
-
getLocalDateTime
-
getOffsetDateTime
-
getOffsetDateTime
-
getSchema
TableSchema getSchema() -
getClickHouseBitmap
-
getClickHouseBitmap
-
getTemporalAmount
-
getTemporalAmount
-