Commit 20add92
Implement Directory Table.
Implement directory table feature in this commit. Directory table is a new
relation which used to organize the unstructured data files in the specified
tablespace. The date files are stored in the specified tablespace while
the tuples recorded the metadata of the data files such as relative_path, md5
size etc. are stored in normal table.
We support local directory table and remote directory table meanwhile. The
local directory table uses the local tablespace while the remote directory
table uses the DFS tablespace which implemented in our enterprise extension.
We support copy binary from to upload file to directory table, directory_table
UDF to get file content, remove_file UDF to remove file from directory table.
What's more, we implement a tool called cbload used to upload file to direcotry
table. Meanwhile, to support DFS directory table, we also import some catalog
tables such as gp_storage_server, gp_storage_user_mapping which are shared in
all databases.
We will illustrage some examples for your convinence of usage as follow.
-- Create an oss_server that points to endpoint:
CREATE STORAGE SERVER oss_server OPTIONS
(protocol 'qingstor', endpoint 'pek3b.qingstor.com', https 'true', virtual_host 'false');
-- Create a user mapping to access oss_server
CREATE STORAGE USER MAPPING FOR CURRENT_USER STORAGE SERVER oss_server OPTIONS
(accesskey 'KGCPPHVCHRDSYFEAWLLC', secretkey '0SJIWiIATh6jOlmAas23q6hOAGBI1BnsnvgJmTs');
-- Create a local tablespace
CREATE TABLESPACE dirtable_spc location '/data/dirtable_spc';
-- Create a local directory table
CREATE DIRECTORY TABLE dirtable TABLESPACE dirtable_spc;
-- Copy binary from directory table
COPY BINARY dirtable FROM '/data/file1.csv' 'file1';
-- Select directory table
SELECT * FROM dirtable;
SELECT * FROM directory_table('dirtable');
-- Remove file from directory table
SELECT remove_file('dirtable', 'file1');
Co-authored-by: Mu Guoqing muguoqing@hashdata.cn
Reviewd-by: Yang Yu yangyu@hashdata.cn
Yang Jianghua yjhjstz@gmail.com1 parent 09ed012 commit 20add92
142 files changed
Lines changed: 11686 additions & 146 deletions
File tree
- contrib
- amcheck
- oid2name
- pg_surgery
- pg_visibility
- pgstattuple
- postgres_fdw
- gpMgmt/bin
- cbload
- loader
- log
- option
- worker
- gpcontrib/gp_distribution_policy
- src
- backend
- access
- aocs
- appendonly
- common
- heap
- catalog
- commands
- executor
- gpopt
- nodes
- optimizer/util
- parser
- postmaster
- rewrite
- storage
- buffer
- file
- ipc
- lmgr
- tcop
- utils
- adt
- cache
- bin
- initdb
- pg_dump
- psql
- scripts
- common
- include
- catalog
- commands
- common
- executor
- nodes
- parser
- storage
- tcop
- utils
- interfaces/ecpg/preproc
- pl/plpgsql/src
- test
- isolation2
- input
- output
- regress
- expected
- input
- output
- singlenode_regress/expected
- tools/pgindent
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
549 | 549 | | |
550 | 550 | | |
551 | 551 | | |
552 | | - | |
| 552 | + | |
| 553 | + | |
553 | 554 | | |
554 | 555 | | |
555 | | - | |
| 556 | + | |
556 | 557 | | |
557 | 558 | | |
558 | 559 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
482 | | - | |
| 482 | + | |
483 | 483 | | |
484 | 484 | | |
485 | 485 | | |
| |||
553 | 553 | | |
554 | 554 | | |
555 | 555 | | |
| 556 | + | |
556 | 557 | | |
557 | 558 | | |
558 | 559 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
377 | | - | |
| 377 | + | |
| 378 | + | |
378 | 379 | | |
379 | 380 | | |
380 | 381 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
778 | 778 | | |
779 | 779 | | |
780 | 780 | | |
781 | | - | |
| 781 | + | |
| 782 | + | |
782 | 783 | | |
783 | 784 | | |
784 | 785 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | | - | |
| 292 | + | |
| 293 | + | |
293 | 294 | | |
294 | 295 | | |
295 | | - | |
| 296 | + | |
296 | 297 | | |
297 | 298 | | |
298 | 299 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
766 | 766 | | |
767 | 767 | | |
768 | 768 | | |
769 | | - | |
| 769 | + | |
| 770 | + | |
770 | 771 | | |
771 | 772 | | |
772 | | - | |
| 773 | + | |
773 | 774 | | |
774 | 775 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
| 264 | + | |
264 | 265 | | |
265 | 266 | | |
266 | 267 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5368 | 5368 | | |
5369 | 5369 | | |
5370 | 5370 | | |
| 5371 | + | |
5371 | 5372 | | |
5372 | 5373 | | |
5373 | 5374 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
0 commit comments