返回首页

gbase数据、南大通用产品文档:GBase8a

更新日期:2024年09月11日

|
-----------------------------------------------------------------------
| primary
|
1
|
2
|
3
|
| segments |
|
|
|
-----------------------------------------------------------------------
|duplicate |
3
|
1
|
2
|
|segments 1|
|
|
|
===========================================================

GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-04-10)
南大通用数据技术股份有限公司
307
============

虚拟集群执行含有div 函数的SQL 报错
DETAIL_numeric overflow
问题描述
Create table tmp_lxj_1008_test as
Select ((substr(hd_iden_no,1,17) div 1000000000000000 mod 10)*9) mod 11
as hd_iden_no_last_bz
From dw_product_realname_base_ds;
集群层gccli 执行sql 报错DETAIL_numeric overflow,单机层gncli 执行sql 报错
ERROR 1366(HY000):Incorrect decimal value: '' for column '' at row -1。
原因分析
经排查为数据中包含了12314123123e137 类似的数据, 导致SQL"select
12314123123e137 div 10000000;"操作将第一个参数解析成科学计数的decimal,
最终
结果溢出。
862 之所以没有问题,
是将12314123123e137 做了截断处理取e 之前的数字作为div
的参数。
解决方法

通过设置参数_gbase_func_compatible_mode,
用于9.5.xx 的函数兼容8.6.XX, 当
前受此参数影响的函数DIV。默认值0 表示不兼容8.6.XX, 1 表示兼容8.6.XX
的函数行为。

通过修改SQL,如:cast(substr(hd_iden_no,1,17) as integer)。

编写和执行SQL 语句.................................. 358