Package com.clickhouse.client
Class ClickHouseColumn
- java.lang.Object
-
- com.clickhouse.client.ClickHouseColumn
-
- All Implemented Interfaces:
Serializable
public final class ClickHouseColumn extends Object implements Serializable
This class represents a column defined in database.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static ClickHouseColumn[]EMPTY_ARRAY
-
Method Summary
-
-
-
Field Detail
-
EMPTY_ARRAY
public static final ClickHouseColumn[] EMPTY_ARRAY
-
-
Method Detail
-
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 zerocount- 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()
-
getPrimitiveClass
public Class<?> getPrimitiveClass()
-
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()
-
getTimeZone
public TimeZone getTimeZone()
-
getPrecision
public int getPrecision()
-
getScale
public int getScale()
-
hasNestedColumn
public boolean hasNestedColumn()
-
getNestedColumns
public List<ClickHouseColumn> getNestedColumns()
-
getKeyInfo
public ClickHouseColumn getKeyInfo()
-
getValueInfo
public ClickHouseColumn getValueInfo()
-
getFunction
public String getFunction()
Gets function when column type isClickHouseDataType.AggregateFunction. So it will returnquantiles(0.5, 0.9)when the column type isAggregateFunction(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 isClickHouseDataType.AggregateFunction. So it will returnClickHouseAggregateFunction.quantilewhen the column type isAggregateFunction(quantiles(0.5, 0.9), UInt64).- Returns:
- function name, null when column type is not AggregateFunction
-
-