Interface ClickHouseBinaryFormatReader

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
AbstractBinaryFormatReader, NativeFormatReader, RowBinaryFormatReader, RowBinaryWithNamesAndTypesFormatReader, RowBinaryWithNamesFormatReader

public interface ClickHouseBinaryFormatReader extends AutoCloseable
  • Method Details

    • readValue

      <T> T readValue(int colIndex)
      Reads a single value from the stream.
      Type Parameters:
      T -
      Returns:
    • readValue

      <T> T readValue(String colName)
      Reads a row to an array of objects.
      Type Parameters:
      T -
      Parameters:
      colName -
      Returns:
    • hasValue

      boolean hasValue(String colName)
    • hasValue

      boolean hasValue(int colIndex)
    • hasNext

      boolean hasNext()
      Checks if there are more rows to read.
      Returns:
    • next

      Map<String,Object> 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

      String getString(String colName)
      Reads column with name `colName` as a string.
      Parameters:
      colName - - column name
      Returns:
    • getByte

      byte getByte(String colName)
      Reads column with name `colName` as a byte.
      Parameters:
      colName - - column name
      Returns:
    • getShort

      short getShort(String colName)
      Reads column with name `colName` as a short.
      Parameters:
      colName - - column name
      Returns:
    • getInteger

      int getInteger(String colName)
      Reads column with name `colName` as an integer.
      Parameters:
      colName - - column name
      Returns:
    • getLong

      long getLong(String colName)
      Reads column with name `colName` as a long.
      Parameters:
      colName - - column name
      Returns:
    • getFloat

      float getFloat(String colName)
      Reads column with name `colName` as a float. Warning: this method may lose precision for float values.
      Parameters:
      colName -
      Returns:
    • getDouble

      double getDouble(String colName)
      Reads column with name `colName` as a double. Warning: this method may lose precision for double values.
      Parameters:
      colName -
      Returns:
    • getBoolean

      boolean getBoolean(String colName)
      Reads column with name `colName` as a boolean.
      Parameters:
      colName -
      Returns:
    • getBigInteger

      BigInteger getBigInteger(String colName)
      Reads column with name `colName` as a BigInteger.
      Parameters:
      colName -
      Returns:
    • getBigDecimal

      BigDecimal getBigDecimal(String colName)
      Reads column with name `colName` as a BigDecimal.
      Parameters:
      colName -
      Returns:
    • getInstant

      Instant getInstant(String colName)
      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

      ZonedDateTime getZonedDateTime(String colName)
      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

      Duration getDuration(String colName)
      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

      Inet4Address getInet4Address(String colName)
      Returns the value of the specified column as an Inet4Address.
      Parameters:
      colName -
      Returns:
    • getInet6Address

      Inet6Address getInet6Address(String colName)
      Returns the value of the specified column as an Inet6Address.
      Parameters:
      colName -
      Returns:
    • getUUID

      UUID getUUID(String colName)
      Returns the value of the specified column as a UUID.
      Parameters:
      colName -
      Returns:
    • getGeoPoint

      ClickHouseGeoPointValue getGeoPoint(String colName)
      Returns the value of the specified column as a ClickHouseGeoPointValue.
      Parameters:
      colName -
      Returns:
    • getGeoRing

      ClickHouseGeoRingValue getGeoRing(String colName)
      Returns the value of the specified column as a ClickHouseGeoRingValue.
      Parameters:
      colName -
      Returns:
    • getGeoPolygon

      ClickHouseGeoPolygonValue getGeoPolygon(String colName)
      Returns the value of the specified column as a ClickHouseGeoPolygonValue.
      Parameters:
      colName -
      Returns:
    • getGeoMultiPolygon

      ClickHouseGeoMultiPolygonValue getGeoMultiPolygon(String colName)
      Returns the value of the specified column as a ClickHouseGeoMultiPolygonValue.
      Parameters:
      colName -
      Returns:
    • getList

      <T> List<T> getList(String colName)
      Reads column with name `colName` as a string.
      Parameters:
      colName - - column name
      Returns:
    • getByteArray

      byte[] getByteArray(String colName)
      Reads column with name `colName` as a string.
      Parameters:
      colName - - column name
      Returns:
    • getIntArray

      int[] getIntArray(String colName)
      Reads column with name `colName` as a string.
      Parameters:
      colName - - column name
      Returns:
    • getLongArray

      long[] getLongArray(String colName)
      Reads column with name `colName` as a string.
      Parameters:
      colName - - column name
      Returns:
    • getFloatArray

      float[] getFloatArray(String colName)
      Reads column with name `colName` as a string.
      Parameters:
      colName - - column name
      Returns:
    • getDoubleArray

      double[] getDoubleArray(String colName)
      Reads column with name `colName` as a string.
      Parameters:
      colName - - column name
      Returns:
    • getBooleanArray

      boolean[] getBooleanArray(String colName)
      Parameters:
      colName -
      Returns:
    • getString

      String getString(int index)
      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

      BigInteger getBigInteger(int index)
      Reads column with name `colName` as a BigInteger.
      Parameters:
      index -
      Returns:
    • getBigDecimal

      BigDecimal getBigDecimal(int index)
      Reads column with name `colName` as a BigDecimal.
      Parameters:
      index -
      Returns:
    • getInstant

      Instant getInstant(int index)
      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

      ZonedDateTime getZonedDateTime(int index)
      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

      Duration getDuration(int index)
      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

      Inet4Address getInet4Address(int index)
      Returns the value of the specified column as an Inet4Address.
      Parameters:
      index -
      Returns:
    • getInet6Address

      Inet6Address getInet6Address(int index)
      Returns the value of the specified column as an Inet6Address.
      Parameters:
      index -
      Returns:
    • getUUID

      UUID getUUID(int index)
      Returns the value of the specified column as a UUID.
      Parameters:
      index -
      Returns:
    • getGeoPoint

      ClickHouseGeoPointValue getGeoPoint(int index)
      Returns the value of the specified column as a ClickHouseGeoPointValue.
      Parameters:
      index -
      Returns:
    • getGeoRing

      ClickHouseGeoRingValue getGeoRing(int index)
      Returns the value of the specified column as a ClickHouseGeoRingValue.
      Parameters:
      index -
      Returns:
    • getGeoPolygon

      ClickHouseGeoPolygonValue getGeoPolygon(int index)
      Returns the value of the specified column as a ClickHouseGeoPolygonValue.
      Parameters:
      index -
      Returns:
    • getGeoMultiPolygon

      ClickHouseGeoMultiPolygonValue getGeoMultiPolygon(int index)
      Returns the value of the specified column as a ClickHouseGeoMultiPolygonValue.
      Parameters:
      index -
      Returns:
    • getList

      <T> List<T> getList(int index)
      Reads column with name `colName` as a string.
      Parameters:
      index - - column name
      Returns:
    • getByteArray

      byte[] getByteArray(int index)
      Reads column with name `colName` as a string.
      Parameters:
      index - - column name
      Returns:
    • getIntArray

      int[] getIntArray(int index)
      Reads column with name `colName` as a string.
      Parameters:
      index - - column name
      Returns:
    • getLongArray

      long[] getLongArray(int index)
      Reads column with name `colName` as a string.
      Parameters:
      index - - column name
      Returns:
    • getFloatArray

      float[] getFloatArray(int index)
      Reads column with name `colName` as a string.
      Parameters:
      index - - column name
      Returns:
    • getDoubleArray

      double[] getDoubleArray(int index)
      Reads column with name `colName` as a string.
      Parameters:
      index - - column name
      Returns:
    • getBooleanArray

      boolean[] getBooleanArray(int index)
    • getTuple

      Object[] getTuple(int index)
    • getTuple

      Object[] getTuple(String colName)
    • getEnum8

      byte getEnum8(String colName)
    • getEnum8

      byte getEnum8(int index)
    • getEnum16

      short getEnum16(String colName)
    • getEnum16

      short getEnum16(int index)
    • getLocalDate

      LocalDate getLocalDate(String colName)
    • getLocalDate

      LocalDate getLocalDate(int index)
    • getLocalDateTime

      LocalDateTime getLocalDateTime(String colName)
    • getLocalDateTime

      LocalDateTime getLocalDateTime(int index)
    • getOffsetDateTime

      OffsetDateTime getOffsetDateTime(String colName)
    • getOffsetDateTime

      OffsetDateTime getOffsetDateTime(int index)
    • getSchema

      TableSchema getSchema()
    • getClickHouseBitmap

      ClickHouseBitmap getClickHouseBitmap(String colName)
    • getClickHouseBitmap

      ClickHouseBitmap getClickHouseBitmap(int index)
    • getTemporalAmount

      TemporalAmount getTemporalAmount(int index)
    • getTemporalAmount

      TemporalAmount getTemporalAmount(String colName)