返回首页

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

更新日期:2024年09月11日

常量TURE 相当于1,而常量FALSE 相当于0。
常量的名字对大小写不敏感。

示例1:查询TRUE 和FALSE 对应的值。
gbase> SELECT TRUE, true, FALSE, false FROM t;
+------+------+-------+-------+
| TRUE | TRUE | FALSE | FALSE |
+------+------+-------+-------+
| 1 | 1 | 0 | 0 |
+------+------+-------+-------+
1 row in set

问题现象
设置group_concat_max_len 参数后,
直接执行SQL 导致执行报错:
”source table
and destination table are not same”

GBase 8a MPP Cluster 最佳实践
5 FAQ
文档版本(2022-02-11)
南大通用数据技术股份有限公司
103
drop table if exists td_calling_type_code_crm2qyzx2yzhy;
create table td_calling_type_code_crm2qyzx2yzhy(yn_vertical_type
varchar(20),crm_calling_type_name varchar(3000));
insert into td_calling_type_code_crm2qyzx2yzhy values('1',repeat('abcde',500));
set global group_concat_max_len=655360;
SELECT c.crm_calling_type_name_all
FROM td_calling_type_code_crm2qyzx2yzhy b
LEFT JOIN (
SELECT group_concat(crm_calling_type_name) crm_calling_type_name_all
,yn_vertical_type
FROM td_calling_type_code_crm2qyzx2yzhy
GROUP BY yn_vertical_type
,crm_calling_type_name
) c ON b.yn_vertical_type = c.yn_vertical_type;
解决方法:
set global group_concat_max_len 之后不退出直接执行sql,不同gn 层取到的
值不一样,
导致创建临时表表结构不一致。
修改全局配置项后需要退出当前会话,
重连生效。
V9 版本支持该参数的session 级设置,
如果只需要当前会话有效,
可以用session
级别设置该参数:set group_concat_max_len=32767;

可用使用以下方法移除 UDR:
public void removeUDR(String sqlname) throws SQLException
public void removeJar(String jarfilesqlname, int undeploy) throws
SQLException
提示: removeUDR() 方法从服务器移除 UDR 但是不移除 JAR 文件,因为其它不透明类型或
UDR 会使用相同的 JAR 文件。
removeJar() 方法在移除不透明类型和 JAR 文件中有所描述。
移除重载的 UDRs
要移除重载的 UDR,请使用具有附加参数的 removeUDR() 方法:
public void removeUDR(String sqlname, Class[] methodparams) throws
SQLException
methodparams 参数指定 UDR 中每个参数的数据类型。
指定 NULL 指示没有参数。
例如,
假设一个名为 print() 的 UDR 被重载了两个额外的方法签名。
Java™ 方法签名
对应的 SQL 名
void print()
print1
void print(String x, String y,
int r)
print2

GBase 8s JDBC Driver 程序员指南
南大通用数据技术股份有限公司
- 187
-
Java™ 方法签名
对应的 SQL 名
void print(int a, int b)
print3
移除所有三个 UDR 的代码为:
udrmgr.removeUDR("print1", null );
udrmgr.removeUDR("print2",
new Class[] {String.class, String.class, int.class} );
udrmgr.removeUDR("print3", new Class[] {int.class, int.class} );