返回首页

gbase数据、南大通用产品文档:GBase8aCREATE TABLE LIKE

更新日期:2024年09月11日

功能说明
源表包含自增列,create table like 的目标表继承自增列属性。
示例

GBase 8a MPP Cluster 产品手册
5 数据库管理指南
文档版本953(2022-09-15)
南大通用数据技术股份有限公司
1011
gbase> CREATE TABLE t1_1 like t1;
Query OK, 0 rows affected (Elapsed: 00:00:00.07)
gbase> SHOW CREATE TABLE t1_1 \G
*************************** 1. row ***************************
Table: t1_1
Create Table: CREATE TABLE "t1_1" (
"name" varchar(10) DEFAULT NULL,
"id" int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY ("id")
)
ENGINE=EXPRESS
DEFAULT
CHARSET=utf8
TABLESPACE='sys_tablespace'
1 row in set (Elapsed: 00:00:00.00)

+5.69900E+002 03/19/2013
1 record(s) selected.
然后退出db2,使用db2to8a 抽取上面查询的数据。
$ cd test
$ ./db2to8a -D'test' -u'db2inst1' -p'db2inst1' -q"select * from t fetch first 1 rows only"
-f'data1.txt' -m'0' -e'|'
you machine is Little endian!

GBase 8a MPP Cluster 产品手册
4 管理员指南
文档版本953(2022-04-10)
南大通用数据技术股份有限公司
558
Connecting to test...
Connected to test.
--- unload [text file] mode ---
--- field="|" ---
0 rows exported at 2013-08-31 14:18:24
1 rows exported at 2013-08-31 14:18:24
output file data1.txt closed
export:
1 rows.
export:
5 columns.
export time:

Hadoop 加载失败问题
问题现象
Hadoop 升级并新增了kerberos 认证功能,执行从hadoop 加载数据时报错:
执行Load data infile ‘hdp://…’into table …报错:
I/O operation on hdp://…HdfsIOException:InputStreamImpl:cannot read
file.
Express 日志中信息显示错误是hadoop server 端抛出的异常:
HdfsIOException:InputStreamImpl:all nodes have been tried and no valid
replica can be read for Block
解决方法:
查看hadoop 日志发现datanode 之间数据传输开启了加密传输:
Failed to read expected SASL data transfer protection handshake from client
at ….Perhaps the client is running an older version of Hadoop which does

GBase 8a MPP Cluster 最佳实践
5 FAQ
文档版本(2022-02-11)
南大通用数据技术股份有限公司
151
not support SASL data transfer protection.
当HDFS 启用Kerberos 认证,并且仅允许HTTPS 连接,datanode 数据传输启用了
传输加密功能时,即hadoop 配置如下时:

dfs.http.policy
HTTPS_ONLY


dfs.data.transfer.protection
authentication

需要配置如下参数才可以正常加载hadoop 数据:
set
global
_gbase_hdfs_rpcconfig=’dfs.encrypt.data.transfer=true,dfs.block.acces
s.token.enable=true’;