incubator-doris Schema Change : errCode = 2, detailMessage = Can not change INT to TINYINT

tquggr8v  于 2022-04-22  发布在  Java
关注(0)|答案(2)|浏览(482)

here is a table
CREATE TABLEtable_v2(date_partitiondate NULL COMMENT "xxx",date_timedatetime NULL COMMENT "xx",is_someint(11) NULL COMMENT "xxxx",uuidhll HLL_UNION NULL COMMENT "xxxx", INDEX xxx_index_date (date_partition) USING BITMAP COMMENT 'xx', INDEX xxxx_is_some (is_some) USING BITMAP COMMENT 'xxx', ) ENGINE=OLAP AGGREGATE KEY(date_partition,date_time,is_some) COMMENT "OLAP-index" PARTITION BY RANGE(date_partition) (PARTITION p20200710 VALUES [('1970-01-01'), ('2020-07-10'))) PROPERTIES ( "replication_num" = "3", "in_memory" = "false", "storage_format" = "V2" );

when schema chage alter table table_v2 modify column is_some TINYINT
then errCode = 2, detailMessage = Can not change INT to TINYINT
but document
5) 目前支持以下类型的转换(精度损失由用户保证) TINYINT/SMALLINT/INT/BIGINT 转换成 TINYINT/SMALLINT/INT/BIGINT/DOUBLE。

1cosmwyk

1cosmwyk1#

For now we not support down cast, you can refer org/apache/doris/catalog/ColumnType.java for more detail

kyvafyod

kyvafyod2#

@yangjun616
incorrection number may caused by down cast.
for example:
65535 is an INT, how to cast to a TINYINT(max is 127)

相关问题