建表及修改字段时,表字段为bigint,设置默认值0时报错

为了更快的定位您的问题,请提供以下信息,谢谢
【详述】建表及修改字段时,表字段为bigint,赋予默认值0时报错
【背景】
【业务影响】
【StarRocks版本】2.5.8
【集群规模】例如:1fe(1 follower+2observer)+3be(fe与be混部)
【机器信息】CPU虚拟核/内存/网卡,例如:48C/64G/万兆
【联系方式】
【附件】
①建表时报错
create table test_alter_column_value(
id bigint comment ‘id’,
age bigint null comment ‘age’,
name varchar(20) default ‘无’ comment ‘姓名’,
number bigint(20) default 1 comment ‘编号’
)engine = olap
primary key(id)
distributed by hash(id) buckets 1
PROPERTIES (
“replication_num” = “3”,
“in_memory” = “false”,
“storage_format” = “DEFAULT”,
“enable_persistent_index” = “false”,
“compression” = “LZ4”
);
报错:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘1’ at line 5


create table test_alter_column_value(
id bigint comment ‘id’,
age bigint null comment ‘age’,
name varchar(20) default ‘无’ comment ‘姓名’,
number bigint(20) comment ‘编号’
)engine = olap
primary key(id)
distributed by hash(id) buckets 1
PROPERTIES (
“replication_num” = “3”,
“in_memory” = “false”,
“storage_format” = “DEFAULT”,
“enable_persistent_index” = “false”,
“compression” = “LZ4”
);

alter table test_alter_column_value modify column number bigint(20) default 0 comment ‘编号’

报错:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘0’ at line 1

官方文档中没有限制数值类型的设置默认值

default后面都加下单引号,比如’1’你试试

尝试过是不行的
alter table test_alter_column_value modify column number bigint(20) default ‘0’ comment ‘编号’
报错信息:Unexpected exception: Can not change default value

你最初建表和alter table的报错是因为default后面的数字没有加引号导致的。alter table的话目前还不支持修改列的默认值。

收到,感谢!
后续有支持修改列默认值的计划吗?建表int类型default的值给个字符串也有点奇怪

支持计划的话之后应该会有。
建表int类型default的值虽然加了引号,但其实默认值还是int的,只是语法校验这块需要有引号