15670430创建于 2020年12月28日历史提交
--hdfs表支持复制表
CREATE SERVER hdfs_server_test FOREIGN DATA WRAPPER 	HDFS_FDW OPTIONS (type 'hdfs', address '@hdfshostname@:@hdfsport@',hdfscfgpath '@hdfscfgpath@');
drop foreign table if exists obs_option_test;
NOTICE:  foreign table "obs_option_test" does not exist, skipping
create foreign table obs_option_test(a int, b int) server hdfs_server_test
options(
format 'csv',
header 'true',
delimiter '|',
foldername '/gaussdbcheck/csv_test/',
checkencoding 'high',
--totalrows '200',
encoding 'utf-8'
) with err_table 
distribute by replication;
WARNING:  The error_relation of the foreign table is not support.
--hdfsde csv\text支持分区表
drop foreign table part_lineitem_00;
ERROR:  foreign table "part_lineitem_00" does not exist
Create foreign table part_lineitem_00 (
 L_ORDERKEY INT4,
 L_PARTKEY INT4,
 L_SUPPKEY INT4,
 L_LINENUMBER INT4,
 L_QUANTITY FLOAT8,
 L_EXTENDEDPRICE FLOAT8,
 L_DISCOUNT FLOAT8,
 L_TAX FLOAT8,
 L_RETURNFLAG TEXT,
 L_LINESTATUS TEXT,
 L_SHIPDATE TEXT,
 L_COMMITDATE TEXT,
 L_RECEIPTDATE TEXT,
 L_SHIPINSTRUCT TEXT,
 L_SHIPMODE TEXT,
 L_COMMENT TEXT,
 part int)
SERVER hdfs_server_test OPTIONS(format 'csv', foldername '/user/hive/warehouse/mppdb_small.db/lineitem_small_part_csv/')
distribute by roundrobin
partition by (part);
select * from part_lineitem_00 order by 1, 2, 3, 4;
 l_orderkey | l_partkey | l_suppkey | l_linenumber | l_quantity | l_extendedprice | l_discount | l_tax | l_returnflag | l_linestatus | l_shipdate | l_commitdate | l_receiptdate |  l_shipinstruct   | l_shipmode |              l_comment              | part 
------------+-----------+-----------+--------------+------------+-----------------+------------+-------+--------------+--------------+------------+--------------+---------------+-------------------+------------+-------------------------------------+------
    5866757 |     66158 |      3677 |            6 |         49 |        55083.35 |        .01 |   .07 | N            | O            | 1998-03-08 | 1998-03-14   | 1998-03-21    | TAKE BACK RETURN  | TRUCK      | stealthily pendi                    | 2018
    5866757 |     69821 |      9822 |            5 |         41 |        73423.62 |        .05 |   .07 | N            | O            | 1998-02-15 | 1998-04-04   | 1998-03-14    | NONE              | RAIL       | ronic, unusual instructions. exp    | 2018
    5866757 |    115416 |      7928 |            7 |         38 |        54393.58 |        .08 |   .08 | N            | O            | 1998-02-06 | 1998-04-16   | 1998-02-28    | DELIVER IN PERSON | RAIL       | ar multipliers across the quickly b | 2018
    5866758 |     93581 |      3582 |            2 |          1 |         1574.58 |        .09 |   .02 | R            | F            | 1994-10-19 | 1994-10-04   | 1994-11-13    | TAKE BACK RETURN  | MAIL       | ly pending                          | 2018
    5866758 |    187202 |      2239 |            1 |         40 |           51568 |        .07 |   .01 | A            | F            | 1994-10-29 | 1994-09-20   | 1994-11-05    | NONE              | MAIL       | ounts-- furiously fin               | 2018
    5866759 |     55747 |      3263 |            5 |         15 |         25541.1 |        .05 |   .08 | N            | O            | 1997-05-06 | 1997-04-18   | 1997-05-23    | TAKE BACK RETURN  | REG AIR    | lithely after the furiously         | 2018
    5866759 |     78514 |      6036 |            2 |         28 |        41790.28 |         .1 |   .04 | N            | O            | 1997-01-27 | 1997-02-27   | 1997-02-21    | COLLECT COD       | SHIP       | s nag according to the              | 2018
    5866759 |    174491 |      9526 |            4 |         28 |        43833.72 |        .09 |   .01 | N            | O            | 1997-05-24 | 1997-04-02   | 1997-06-04    | COLLECT COD       | MAIL       | into beans b                        | 2018
    5866759 |    177384 |      4936 |            1 |          3 |         4384.14 |        .05 |   .01 | N            | O            | 1997-05-07 | 1997-02-28   | 1997-06-03    | NONE              | SHIP       |  bold deposits cajole carefully aga | 2018
    5866759 |    181126 |      1127 |            3 |          7 |         8449.84 |        .05 |   .01 | N            | O            | 1997-03-17 | 1997-04-22   | 1997-04-08    | COLLECT COD       | SHIP       | eposits. regula                     | 2018
(10 rows)

drop server hdfs_server_test cascade;
NOTICE:  drop cascades to 2 other objects
DETAIL:  drop cascades to foreign table obs_option_test
drop cascades to foreign table part_lineitem_00