Package com.clickhouse.data
Class ClickHouseColumn
java.lang.Object
com.clickhouse.data.ClickHouseColumn
- All Implemented Interfaces:
Serializable
This class represents a column defined in database.
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanGets aggregate function when column type isClickHouseDataType.AggregateFunction.intintintintGets function when column type isClickHouseDataType.AggregateFunction.Class<?>getObjectClass(ClickHouseDataConfig config) Class<?>intClass<?>intgetScale()getTimeZoneOrDefault(TimeZone defaultTz) inthashCode()booleanbooleanbooleanbooleanisArray()booleanisEnum()booleanbooleanbooleanbooleanbooleanbooleanisMap()booleanisNested()booleanbooleanbooleanisTuple()newArrayValue(ClickHouseDataConfig config) newValue(ClickHouseDataConfig config) static ClickHouseColumnof(String columnName, ClickHouseDataType dataType, boolean nullable, boolean lowCardinality, String... parameters) static ClickHouseColumnof(String columnName, ClickHouseDataType dataType, boolean nullable, int precision, int scale) static ClickHouseColumnof(String columnName, ClickHouseDataType dataType, boolean nullable, ClickHouseColumn... nestedColumns) static ClickHouseColumnstatic List<ClickHouseColumn>protected static intreadColumn(String args, int startIndex, int len, String name, List<ClickHouseColumn> list) protected voidsetColumnIndex(int index, int count) Sets zero-based column index and column count.toString()
-
Field Details
-
TYPE_NAME
- See Also:
-
EMPTY_ARRAY
-
-
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
-
parse
-
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
-
getDataType
-
getObjectClass
-
getObjectClassForArray
-
getPrimitiveClass
-
getEnumConstants
-
getEstimatedLength
public int getEstimatedLength() -
getColumnCount
public int getColumnCount() -
getColumnIndex
public int getColumnIndex() -
getColumnName
-
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
-
getTimeZoneOrDefault
-
getPrecision
public int getPrecision() -
getScale
public int getScale() -
hasNestedColumn
public boolean hasNestedColumn() -
getNestedColumns
-
getParameters
-
getKeyInfo
-
getValueInfo
-
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
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
-
newArrayValue
-
newValue
-
hashCode
public int hashCode() -
equals
-
toString
-