Class ClickHouseColumn

java.lang.Object
com.clickhouse.data.ClickHouseColumn
All Implemented Interfaces:
Serializable

public final class ClickHouseColumn extends Object implements Serializable
This class represents a column defined in database.
See Also:
  • Field Details

  • Method Details

    • readColumn

      protected static int readColumn(String args, int startIndex, int len, String name, List<ClickHouseColumn> list)
    • of

      public static ClickHouseColumn of(String columnName, ClickHouseDataType dataType, boolean nullable, int precision, int scale)
    • of

      public static ClickHouseColumn of(String columnName, ClickHouseDataType dataType, boolean nullable, boolean lowCardinality, String... parameters)
    • of

      public static ClickHouseColumn of(String columnName, ClickHouseDataType dataType, boolean nullable, ClickHouseColumn... nestedColumns)
    • of

      public static ClickHouseColumn of(String columnName, String columnType)
    • parse

      public static List<ClickHouseColumn> parse(String args)
    • setColumnIndex

      protected void setColumnIndex(int index, int count)
      Sets zero-based column index and column count.
      Parameters:
      index - zero-based column index, negative number is treated as zero
      count - column count, should be always greater than one
    • isAggregateFunction

      public boolean isAggregateFunction()
    • isArray

      public boolean isArray()
    • isEnum

      public boolean isEnum()
    • isFixedLength

      public boolean isFixedLength()
    • isMap

      public boolean isMap()
    • isNested

      public boolean isNested()
    • isTuple

      public boolean isTuple()
    • isNestedType

      public boolean isNestedType()
    • getArrayNestedLevel

      public int getArrayNestedLevel()
    • getArrayBaseColumn

      public ClickHouseColumn getArrayBaseColumn()
    • getDataType

      public ClickHouseDataType getDataType()
    • getObjectClass

      public Class<?> getObjectClass(ClickHouseDataConfig config)
    • getObjectClassForArray

      public Class<?> getObjectClassForArray(ClickHouseDataConfig config)
    • getPrimitiveClass

      public Class<?> getPrimitiveClass(ClickHouseDataConfig config)
    • getEnumConstants

      public ClickHouseEnum getEnumConstants()
    • getEstimatedLength

      public int getEstimatedLength()
    • getColumnCount

      public int getColumnCount()
    • getColumnIndex

      public int getColumnIndex()
    • getColumnName

      public String getColumnName()
    • getOriginalTypeName

      public String getOriginalTypeName()
    • isFirstColumn

      public boolean isFirstColumn()
    • isLastColumn

      public boolean isLastColumn()
    • isNullable

      public boolean isNullable()
    • isLowCardinality

      public boolean isLowCardinality()
    • isLowCardinalityDisabled

      public boolean isLowCardinalityDisabled()
    • disableLowCardinality

      public void disableLowCardinality()
    • hasTimeZone

      public boolean hasTimeZone()
    • getTimeZone

      public TimeZone getTimeZone()
    • getTimeZoneOrDefault

      public TimeZone getTimeZoneOrDefault(TimeZone defaultTz)
    • getPrecision

      public int getPrecision()
    • getScale

      public int getScale()
    • hasNestedColumn

      public boolean hasNestedColumn()
    • getNestedColumns

      public List<ClickHouseColumn> getNestedColumns()
    • getParameters

      public List<String> getParameters()
    • getKeyInfo

      public ClickHouseColumn getKeyInfo()
    • getValueInfo

      public ClickHouseColumn getValueInfo()
    • getFunction

      public String getFunction()
      Gets function when column type is ClickHouseDataType.AggregateFunction. So it will return quantiles(0.5, 0.9) when the column type is AggregateFunction(quantiles(0.5, 0.9), UInt64).
      Returns:
      function, null when column type is not AggregateFunction
    • getAggregateFunction

      public ClickHouseAggregateFunction getAggregateFunction()
      Gets aggregate function when column type is ClickHouseDataType.AggregateFunction. So it will return ClickHouseAggregateFunction.quantile when the column type is AggregateFunction(quantiles(0.5, 0.9), UInt64).
      Returns:
      function name, null when column type is not AggregateFunction
    • newArrayValue

      public ClickHouseArraySequence newArrayValue(ClickHouseDataConfig config)
    • newValue

      public ClickHouseValue newValue(ClickHouseDataConfig config)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object