select table_name,round(data_length/1024/1024/1024,2)
from information_schema.tables
where table_schema='@username@'
and CREATE_OPTIONS<>'partitioned'
and data_length>@table_size@
union all
select concat(table_name,':',partition_name),round(data_length/1024/1024/1024,2)
from information_schema.partitions
where table_schema='@username@'
and table_name not in (select table_name from information_schema.tables where table_schema='@username@' and CREATE_OPTIONS<>'partitioned')
and data_length>@table_size@
按照文档内的规则文件导入的规则,表大小的单位是GB,value是10.0:
执行审核规则时的SQL语句,@table_size@会被直接替换成10,没有做GB的单位转换,导致几乎所有的表都违反规则:
目前我直接将SQL语句替换为
因为定义的规则中有parm_unit字段,不知是否有统一的单位格式化模块。