匿名用户GBase南大通用GBase8a集群加载时数据文件与表定义中字段数不一致的处理
GBase南大通用GBase8a集群加载时数据文件与表定义中字段数不一致的处理
我来答
添加附件
收藏
分享
问题补充
1条回答
默认
最新
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
墨值悬赏
匿名用户GBase南大通用GBase8a集群加载时数据文件与表定义中字段数不一致的处理
GBase南大通用GBase8a集群加载时数据文件与表定义中字段数不一致的处理方法:
表结构
create table tt(fi int,fii int,flen int,fv varchar(200),fx int) distributed by ('fi');
1. 文件中字段多于表定义的情况
数据文件
1,2,3,ABC,4,a,5
2,3,4,BCD,5,b,6
3,4,5,CDE,6,c,7
4,5,6,DEF,7,d,8
1,2,3,ABC,4,a,5
2,3,4,BCD,5,b,6
3,4,5,CDE,6,c,7
4,5,6,DEF,7,d,8
加载用控制文件:
[tt]
disp_server=192.168.105.35:6660
socket=/tmp/gbase_8a_5050.sock
file_list=/home/gbase/tt.txt
db_name=mydb
table_name=tt
format=3
delimiter=','
hash_parallel=2
table_fields=fi,fii,flen,fv,fx,x filler,x1 filler
2. 文件中字段少于表定义的情况
数据文件:
1,2,3,4
2,3,4,5
3,4,5,6
4,5,6,7
1,2,3,4
2,3,4,5
3,4,5,6
4,5,6,7
加载控制文件:
[tt]
disp_server=192.168.105.35:6660
socket=/tmp/gbase_8a_5050.sock
file_list=/home/gbase/tt.txt.2
db_name=mydb
table_name=tt2
format=3
delimiter=','
hash_parallel=2
table_fields=fi,fii,flen,fx
评论
有用 0
墨值悬赏