private static ClickHouseColumn update(ClickHouseColumn column) {
        column.enumConstants = ClickHouseEnum.EMPTY;
        int size = column.parameters.size();
        column.precision = column.dataType.getMaxPrecision();
        switch (column.dataType) {
            case Array:
                if (!column.nested.isEmpty()) {
                    column.arrayLevel = 1;
                    column.arrayBaseColumn = column.nested.get(0);
                    while (column.arrayLevel < 255) {
                        if (column.arrayBaseColumn.dataType == ClickHouseDataType.Array) {
                            column.arrayLevel++;
                            column.arrayBaseColumn = column.arrayBaseColumn.nested.get(0);
                        } else {
                            break;
                        }
                    }
                }
                break;
            case Bool:
                column.template = ClickHouseBoolValue.ofNull();
                break;
            case Enum:
            case Enum8:
            case Enum16:
                column.template = ClickHouseEnumValue
                        .ofNull(column.enumConstants = new ClickHouseEnum(column.parameters));
                break;
            case Int8:
                column.template = ClickHouseByteValue.ofNull();
                break;
            case Int16:
                column.template = ClickHouseShortValue.ofNull();
                break;
            case Int32:
                column.template = ClickHouseIntegerValue.ofNull();
                break;
            case IntervalYear:
            case IntervalQuarter:
            case IntervalMonth:
            case IntervalWeek:
            case IntervalDay:
            case IntervalHour:
            case IntervalMinute:
            case IntervalSecond:
            case IntervalMicrosecond:
            case IntervalMillisecond:
            case IntervalNanosecond:
            case Int64:
                column.template = ClickHouseLongValue.ofNull(false);
                break;
            case UInt64:
                column.template = ClickHouseLongValue.ofUnsignedNull();
                break;
            case Int128:
            case UInt128:
            case Int256:
            case UInt256:
                column.template = ClickHouseBigIntegerValue.ofNull();
                break;
            case Float32:
                column.template = ClickHouseFloatValue.ofNull();
                break;
            case Float64:
                column.template = ClickHouseDoubleValue.ofNull();
                break;
            case Date:
            case Date32:
                column.template = ClickHouseDateValue.ofNull();
                break;
            case DateTime:
                if (size >= 2) { // same as DateTime64
                    if (!column.nullable) {
                        column.estimatedByteLength += ClickHouseDataType.DateTime64.getByteLength();
                    }
                    column.template = ClickHouseOffsetDateTimeValue.ofNull(
                            column.scale = Integer.parseInt(column.parameters.get(0)),
                            column.timeZone = TimeZone.getTimeZone(column.parameters.get(1).replace("'", "")));
                } else if (size == 1) { // same as DateTime32
                    if (!column.nullable) {
                        column.estimatedByteLength += ClickHouseDataType.DateTime32.getByteLength();
                    }
                    column.template = ClickHouseOffsetDateTimeValue.ofNull(
                            column.scale,
                            // unfortunately this will fall back to GMT if the time zone cannot be resolved
                            column.timeZone = TimeZone.getTimeZone(column.parameters.get(0).replace("'", "")));
                }
                break;
            case DateTime32:
                if (size > 0) {
                    column.template = ClickHouseOffsetDateTimeValue.ofNull(
                            column.scale,
                            // unfortunately this will fall back to GMT if the time zone cannot be resolved
                            column.timeZone = TimeZone.getTimeZone(column.parameters.get(0).replace("'", "")));
                }
                break;
            case DateTime64:
                if (size > 0) {
                    column.scale = Integer.parseInt(column.parameters.get(0));
                }
                if (size > 1) {
                    column.template = ClickHouseOffsetDateTimeValue.ofNull(
                            column.scale,
                            column.timeZone = TimeZone.getTimeZone(column.parameters.get(1).replace("'", "")));
                }
                break;
            case Decimal:
                if (size >= 2) {
                    column.precision = Integer.parseInt(column.parameters.get(0));
                    column.scale = Integer.parseInt(column.parameters.get(1));

                    if (!column.nullable) {
                        if (column.precision > ClickHouseDataType.Decimal128.getMaxScale()) {
                            column.estimatedByteLength += ClickHouseDataType.Decimal256.getByteLength();
                        } else if (column.precision > ClickHouseDataType.Decimal64.getMaxScale()) {
                            column.estimatedByteLength += ClickHouseDataType.Decimal128.getByteLength();
                        } else if (column.precision > ClickHouseDataType.Decimal32.getMaxScale()) {
                            column.estimatedByteLength += ClickHouseDataType.Decimal64.getByteLength();
                        } else {
                            column.estimatedByteLength += ClickHouseDataType.Decimal32.getByteLength();
                        }
                    }
                }
                column.template = ClickHouseBigDecimalValue.ofNull();
                break;
            case Decimal32:
            case Decimal64:
            case Decimal128:
            case Decimal256:
                if (size > 0) {
                    column.scale = Integer.parseInt(column.parameters.get(0));
                }
                column.template = ClickHouseBigDecimalValue.ofNull();
                break;
            case IPv4:
                column.template = ClickHouseIpv4Value.ofNull();
                break;
            case IPv6:
                column.template = ClickHouseIpv6Value.ofNull();
                break;
            case FixedString:
                if (size > 0) {
                    column.precision = Integer.parseInt(column.parameters.get(0));
                    if (!column.nullable) {
                        column.estimatedByteLength += column.precision;
                    }
                }
                column.template = ClickHouseStringValue.ofNull();
                break;
            case Object:
            case JSON:
            case String:
                column.fixedByteLength = false;
                if (!column.nullable) {
                    column.estimatedByteLength += 1;
                }
                column.template = ClickHouseStringValue.ofNull();
                break;
            case UUID:
                column.template = ClickHouseUuidValue.ofNull();
                break;
            case Point:
                column.template = ClickHouseGeoPointValue.ofOrigin();
                break;
            case Ring:
                column.template = ClickHouseGeoRingValue.ofEmpty();
                break;
            case Polygon:
                column.template = ClickHouseGeoPolygonValue.ofEmpty();
                break;
            case MultiPolygon:
                column.template = ClickHouseGeoMultiPolygonValue.ofEmpty();
                break;
            case Nested:
                column.template = ClickHouseNestedValue.ofEmpty(column.nested);
                break;
            case Tuple:
                column.template = ClickHouseTupleValue.of();
                break;
            case Nothing:
                column.template = ClickHouseEmptyValue.INSTANCE;
                break;
            case Variant:
                column.template = ClickHouseTupleValue.of();
                break;
            default:
                break;
        }

        return column;
    }
This class represents a column defined in database.
clickhouse-data/src/main/java/com/clickhouse/data/ClickHouseColumn.java