Edgardo  发表于 2021-5-24 09:46 显示全部楼层 楼主
请问如何用通配符加载部分匹配文件?
蓝墨水  发表于 2021-5-24 09:47 显示全部楼层 沙发
[gbase@rh6-1 ~]$ gccli testdb -e"load data infile 'sftp://gbase:gbase1234@10.0.2.201/home/gbase/zxq/1/*.txt' into table tt1" -vvv
--------------
[gbase@rh6-1 gcinstall]$ gccli testdb -e"load data infile 'sftp://gbase:gbase1234@10.0.2.201/home/gbase/zxq/1/*.txt' into table tt1" -vvv
--------------
load data infile 'sftp://gbase:gbase1234@10.0.2.201/home/gbase/zxq/1/*.txt' into table tt1
--------------

Query OK, 4 rows affected (Elapsed: 00:00:01.90)
Task 4718649 finished, Loaded 4 records, Skipped 0 records

Bye
[gbase@rh6-1 gcinstall]$
蓝墨水  发表于 2021-5-24 09:48 显示全部楼层 板凳
使用问号精确匹配
如下只加载1个名字带.txt的

[gbase@rh6-1 gcinstall]$ gccli testdb -e"load data infile 'sftp://gbase:gbase1234@10.0.2.201/home/gbase/zxq/1/?.txt' into table tt1" -vvv
--------------
load data infile 'sftp://gbase:gbase1234@10.0.2.201/home/gbase/zxq/1/?.txt' into table tt1
--------------

Query OK, 3 rows affected (Elapsed: 00:00:01.34)
Task 4718650 finished, Loaded 3 records, Skipped 0 records

Bye
[gbase@rh6-1 gcinstall]$
蓝墨水  发表于 2021-5-24 09:49 显示全部楼层 地板
正则匹配
加载以0和9的txt文件

[gbase@rh6-1 gcinstall]$ gccli testdb -e"load data infile 'sftp://gbase:gbase1234@10.0.2.201/home/gbase/zxq/1/[0-1].txt' into table tt1" -vvv
--------------
load data infile 'sftp://gbase:gbase1234@10.0.2.201/home/gbase/zxq/1/[0-1].txt' into table tt1
--------------

Query OK, 1 row affected (Elapsed: 00:00:00.68)
Task 4718658 finished, Loaded 1 records, Skipped 0 records

Bye
您需要登录后才可以回帖 登录 | 立即注册