返回首页

gbase数据、南大通用产品文档:GBase8a指定导出的文件个数

更新日期:2024年09月11日

在SELECT INTO OUTFILE 语句中可以指定FILECOUNT 参数指定并行导出的文
件个数,
文件命名方式为file_title+suffix+file_ext 形式,
其中file_title 是file_name
中’.’之前的部分,file_ext 为file_name 中’.’之后的部分(包含’.’)suffix
为自动追加的文件名后缀,第一个文件名后缀是“_1”,以此类推。
示例
示例1:指定导出的文件个数FILECOUNT(本地导出时本参数不起作用)。
示例中所用的表及数据:
DROP TABLE IF EXISTS test;
CREATE TABLE test (ps_partkey bigint,ps_suppkey bigint,ps_availqty
bigint,ps_supplycost decimal(15,2),ps_comment varchar(200));
gbase>select * from test;
+------+------+------+--------+-------------------------------------+
| a
| b
| c
| d
| e
|
+------+------+------+--------+-------------------------------------
|
1 |
2 | 3325 | 771.64 | , even theodolites. regular
|
|
1 | 2502 | 8076 | 993.49 | ven ideas. quickly
|
|
1 | 5002 | 3956 | 337.09 | after the fluffily ironic
|
|
1 | 7502 | 4069 | 357.84 | al, regular dependencies
|
|
2 |
3 | 8895 | 378.49 | nic accounts. final accounts
|
|
2 | 2503 | 4969 | 915.27 | ptotes. quickly pending
|
|
2 | 5003 | 8539 | 438.37 | blithely bold ideas. furiously
|
|
2 | 7503 | 3025 | 306.39 | olites. deposits wake carefully
|
|
3 |
4 | 4651 | 920.92 | ilent foxes affix furiously quickly |
|
3 | 2504 | 4093 | 498.13 | ending dependencies haggle fluffily |
|
3 | 5004 | 3917 | 645.40 | of the blithely regular theodolites |
|
3 | 7504 | 9942 | 191.92 | unusual, ironic foxes according
|
|
4 |
5 | 1339 | 113.97 | carefully unusual ideas. packages
|
|
4 | 2505 | 6377 | 591.18 | ly final courts haggle
|
|
4 | 5005 | 2694 |

跨引擎功能需要确保hdfs 的容量安全,所以需要对所用hdfs 目录进行配额设置。
"/tmp/gbase8up" 为跨引擎查询的临时目录,如果没有需要手动创建
"/user/hive/warehouse"为hive 数据存储目录。
配额阈值配置依据:

应大于业务表最大容量需求

需同时满足HDFS 空间容量处于安全状态,小于最大可用容量
//手动创建目录/tmp/gbase8up
$ ./hdfs dfs –mkdir -p /tmp/gbase8up
//默认配置最小空间为10G,配额容量要大于10G,可根据具体情况进行调整【如下设置100G 仅
为示例】
$ ./hdfs dfsadmin -setSpaceQuota 100G /tmp/gbase8up
//查询配额配置
$ ./hdfs dfs -count -q /tmp/gbase8up
none inf 107374182400 107374182400 1 0 0 /tmp/gbase8up

GBase UP 产品手册 2 产品描述

文档版本04(2021-04-21) 南大通用数据技术股份有限公司 21
//默认配置最小空间为10G,配额容量要大于10G,可根据具体情况进行调整为合理值【如下设
置100G 仅为示例】
$./hdfs dfsadmin -setSpaceQuota 100G /user/hive/warehouse
//查询配额配置
$ ./hdfs dfs -count -q /user/hive/warehouse
none inf 107374182400 107374182400 1 0 0 /user/hive/warehouse

函数说明

返回N 的二进制形式,N 是BIGINT 类型数值;

如果N 是一个NULL,返回值为NULL。
示例

GBase 8a MPP Cluster 产品手册
5 数据库管理指南
文档版本953(2022-09-15)
南大通用数据技术股份有限公司
683
示例1:N 的值为“12”,返回“12”对应的二进制形式。
gbase> SELECT BIN(12) FROM dual;
+---------+
| BIN(12) |
+---------+
| 1100
|
+---------+
1 row in set