From 2f10abea394ad04ab33f00e4eab479c85aa7e795 Mon Sep 17 00:00:00 2001 From: Adam Lee Date: Wed, 6 Jul 2016 13:48:01 +0800 Subject: [PATCH] s3ext: refactor regress codes (#909) 1. add expected output files 2. add schedule file 3. use pg_regress to check results automatically 4. refactor gpcheckcloud regress shell script Signed-off-by: Haozhou Wang --- gpAux/extensions/gps3ext/.gitignore | 7 + gpAux/extensions/gps3ext/regress/Makefile | 10 + .../gps3ext/regress/gpcheckcloud_regress.sh | 44 ++++ .../1_01_normal.source} | 10 - .../1_02_log_error.source} | 10 - .../1_03_bad_data.source} | 12 +- .../1_04_empty_prefix.source} | 10 - .../1_05_one_line.source} | 10 - .../1_06_1correct_1wrong.source} | 12 +- .../1_07_huge_bad_data.source} | 11 - .../1_08_huge_correct_data.source} | 10 - .../1_09_partition.source} | 10 - .../1_10_all_regions.source} | 19 -- .../1_11_gzipped_data.source} | 10 - .../1_12_no_prefix.source} | 13 - .../2_01_invalid_syntax.source} | 10 - .../2_02_invalid_region.source} | 10 - .../2_03_invalid_config.source} | 10 - .../2_04_invalid_header.source} | 10 - .../gps3ext/regress/output/1_01_normal.source | 31 +++ .../regress/output/1_02_log_error.source | 24 ++ .../regress/output/1_03_bad_data.source | 30 +++ .../regress/output/1_04_empty_prefix.source | 24 ++ .../regress/output/1_05_one_line.source | 19 ++ .../output/1_06_1correct_1wrong.source | 28 +++ .../regress/output/1_07_huge_bad_data.source | 19 ++ .../output/1_08_huge_correct_data.source | 18 ++ .../regress/output/1_09_partition.source | 40 +++ .../regress/output/1_10_all_regions.source | 235 ++++++++++++++++++ .../regress/output/1_11_gzipped_data.source | 40 +++ .../regress/output/1_12_no_prefix.source | 85 +++++++ .../regress/output/2_01_invalid_syntax.source | 19 ++ .../regress/output/2_02_invalid_region.source | 17 ++ .../regress/output/2_03_invalid_config.source | 16 ++ .../regress/output/2_04_invalid_header.source | 16 ++ gpAux/extensions/gps3ext/regress/regress.sh | 34 --- .../gps3ext/regress/s3_regress_schedule | 16 ++ 37 files changed, 742 insertions(+), 207 deletions(-) create mode 100644 gpAux/extensions/gps3ext/regress/Makefile create mode 100755 gpAux/extensions/gps3ext/regress/gpcheckcloud_regress.sh rename gpAux/extensions/gps3ext/regress/{regress_1.01.sql => input/1_01_normal.source} (83%) rename gpAux/extensions/gps3ext/regress/{regress_1.02.sql => input/1_02_log_error.source} (84%) rename gpAux/extensions/gps3ext/regress/{regress_1.03.sql => input/1_03_bad_data.source} (83%) rename gpAux/extensions/gps3ext/regress/{regress_1.04.sql => input/1_04_empty_prefix.source} (83%) rename gpAux/extensions/gps3ext/regress/{regress_1.05.sql => input/1_05_one_line.source} (82%) rename gpAux/extensions/gps3ext/regress/{regress_1.06.sql => input/1_06_1correct_1wrong.source} (84%) rename gpAux/extensions/gps3ext/regress/{regress_1.07.sql => input/1_07_huge_bad_data.source} (56%) rename gpAux/extensions/gps3ext/regress/{regress_1.08.sql => input/1_08_huge_correct_data.source} (88%) rename gpAux/extensions/gps3ext/regress/{regress_1.09.sql => input/1_09_partition.source} (90%) rename gpAux/extensions/gps3ext/regress/{regress_1.10.sql => input/1_10_all_regions.source} (93%) rename gpAux/extensions/gps3ext/regress/{regress_1.11.sql => input/1_11_gzipped_data.source} (91%) rename gpAux/extensions/gps3ext/regress/{regress_1.12.sql => input/1_12_no_prefix.source} (88%) rename gpAux/extensions/gps3ext/regress/{regress_2.01.sql => input/2_01_invalid_syntax.source} (82%) rename gpAux/extensions/gps3ext/regress/{regress_2.02.sql => input/2_02_invalid_region.source} (81%) rename gpAux/extensions/gps3ext/regress/{regress_2.03.sql => input/2_03_invalid_config.source} (81%) rename gpAux/extensions/gps3ext/regress/{regress_2.04.sql => input/2_04_invalid_header.source} (82%) create mode 100644 gpAux/extensions/gps3ext/regress/output/1_01_normal.source create mode 100644 gpAux/extensions/gps3ext/regress/output/1_02_log_error.source create mode 100644 gpAux/extensions/gps3ext/regress/output/1_03_bad_data.source create mode 100644 gpAux/extensions/gps3ext/regress/output/1_04_empty_prefix.source create mode 100644 gpAux/extensions/gps3ext/regress/output/1_05_one_line.source create mode 100644 gpAux/extensions/gps3ext/regress/output/1_06_1correct_1wrong.source create mode 100644 gpAux/extensions/gps3ext/regress/output/1_07_huge_bad_data.source create mode 100644 gpAux/extensions/gps3ext/regress/output/1_08_huge_correct_data.source create mode 100644 gpAux/extensions/gps3ext/regress/output/1_09_partition.source create mode 100644 gpAux/extensions/gps3ext/regress/output/1_10_all_regions.source create mode 100644 gpAux/extensions/gps3ext/regress/output/1_11_gzipped_data.source create mode 100644 gpAux/extensions/gps3ext/regress/output/1_12_no_prefix.source create mode 100644 gpAux/extensions/gps3ext/regress/output/2_01_invalid_syntax.source create mode 100644 gpAux/extensions/gps3ext/regress/output/2_02_invalid_region.source create mode 100644 gpAux/extensions/gps3ext/regress/output/2_03_invalid_config.source create mode 100644 gpAux/extensions/gps3ext/regress/output/2_04_invalid_header.source delete mode 100755 gpAux/extensions/gps3ext/regress/regress.sh create mode 100644 gpAux/extensions/gps3ext/regress/s3_regress_schedule diff --git a/gpAux/extensions/gps3ext/.gitignore b/gpAux/extensions/gps3ext/.gitignore index 146fa1e805b1..21cc16bf2d58 100644 --- a/gpAux/extensions/gps3ext/.gitignore +++ b/gpAux/extensions/gps3ext/.gitignore @@ -53,3 +53,10 @@ s3test gpcheckcloud s3.conf + +sql +expected +results + +*.out +*.diffs diff --git a/gpAux/extensions/gps3ext/regress/Makefile b/gpAux/extensions/gps3ext/regress/Makefile new file mode 100644 index 000000000000..5a4aaa2fc81f --- /dev/null +++ b/gpAux/extensions/gps3ext/regress/Makefile @@ -0,0 +1,10 @@ +top_builddir = $(shell cd ../../../.. && pwd) +include $(top_builddir)/src/Makefile.global + +installcheck: + $(top_builddir)/src/test/regress/pg_regress --psqldir=$$GPHOME/bin/ --schedule=s3_regress_schedule + +clean: + rm -rf sql expected results regression.* optimizer_status.out + +.PHONY: installcheck clean diff --git a/gpAux/extensions/gps3ext/regress/gpcheckcloud_regress.sh b/gpAux/extensions/gps3ext/regress/gpcheckcloud_regress.sh new file mode 100755 index 000000000000..bcf4916dd1d1 --- /dev/null +++ b/gpAux/extensions/gps3ext/regress/gpcheckcloud_regress.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +EXIT_CODE=0 +GPCHECKCLOUD=./bin/gpcheckcloud/gpcheckcloud + +PREFIX[0]="http://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset1/small17/data0014" +PREFIX[1]="http://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset1/small17/data0016" +PREFIX[2]="https://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset1/small17/data0014" +PREFIX[3]="https://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset1/small17/data0016" +PREFIX[4]="https://s3-us-west-2.amazonaws.com/s3test.pivotal.io/gzipped/data0001.gz" +PREFIX[5]="s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/threebytes/" +PREFIX[6]="s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset1/small17/" +PREFIX[7]="s3://s3-us-east-1.amazonaws.com/useast1.s3test.pivotal.io/small17/" +PREFIX[8]="s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/gzipped/" +PREFIX[9]="s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset1/gzipped_normal1/" + +HASHSUM[0]="68c4a63b721e7af0ae945ce109ca87ad" +HASHSUM[1]="0fd502a303eb8f138f5916ec357721b1" +HASHSUM[2]="68c4a63b721e7af0ae945ce109ca87ad" +HASHSUM[3]="0fd502a303eb8f138f5916ec357721b1" +HASHSUM[4]="b958fb80b98605a6095e6ebc4b9b4786" +HASHSUM[5]="fe7d81814e02eb1296757e75bb3c6be9" +HASHSUM[6]="138fc555074671912125ba692c678246" +HASHSUM[7]="138fc555074671912125ba692c678246" +HASHSUM[8]="7b2260e9a3a3f26e84aa28dc2124f68f" +HASHSUM[9]="eacb7b210d3f7703ee06d16f520b103e" + +#HUGE FILES +PREFIX[10]="https://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset2/hugefile/airlinedata1.csv" +PREFIX[11]="s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset2/hugefile/" +PREFIX[12]="s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset2/gzipped_normal2/" + +HASHSUM[10]="f5811ad92c994f1d6913d5338575fe38" +HASHSUM[11]="75baaa39f2b1544ed8af437c2cad86b7" +HASHSUM[12]="a930794bc885bccf6eed45bd40367a7d" + +for ((i=0; i<${#PREFIX[@]}; i++)) +do + [ `$GPCHECKCLOUD -d "${PREFIX[$i]} config=/home/gpadmin/s3.conf" 2>/dev/null |md5sum |cut -d ' ' -f 1` = "${HASHSUM[$i]}" ] \ + && echo test ${PREFIX[$i]} ... ok \ + || { EXIT_CODE=1; echo test ${PREFIX[$i]} ... failed; } +done + +exit $EXIT_CODE diff --git a/gpAux/extensions/gps3ext/regress/regress_1.01.sql b/gpAux/extensions/gps3ext/regress/input/1_01_normal.source similarity index 83% rename from gpAux/extensions/gps3ext/regress/regress_1.01.sql rename to gpAux/extensions/gps3ext/regress/input/1_01_normal.source index 1b17d8ba6262..09b362b7adc6 100644 --- a/gpAux/extensions/gps3ext/regress/regress_1.01.sql +++ b/gpAux/extensions/gps3ext/regress/input/1_01_normal.source @@ -1,7 +1,3 @@ --- ======== --- PROTOCOL --- ======== - -- create the database functions CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; @@ -11,9 +7,6 @@ CREATE PROTOCOL s3 ( readfunc = read_from_s3 ); --- Check out the catalog table -select * from pg_extprotocol; - drop external table s3example; create READABLE external table s3example (date text, time text, open float, high float, low float, volume int) location('s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset1/normal/ config=/home/gpadmin/s3.conf') FORMAT 'csv'; @@ -22,9 +15,6 @@ SELECT count(*) FROM s3example; SELECT sum(open) FROM s3example; SELECT avg(open) FROM s3example; --- ======= --- CLEANUP --- ======= DROP EXTERNAL TABLE s3example; DROP PROTOCOL s3; diff --git a/gpAux/extensions/gps3ext/regress/regress_1.02.sql b/gpAux/extensions/gps3ext/regress/input/1_02_log_error.source similarity index 84% rename from gpAux/extensions/gps3ext/regress/regress_1.02.sql rename to gpAux/extensions/gps3ext/regress/input/1_02_log_error.source index 2261ea2b8f76..a6eed04c2956 100644 --- a/gpAux/extensions/gps3ext/regress/regress_1.02.sql +++ b/gpAux/extensions/gps3ext/regress/input/1_02_log_error.source @@ -1,7 +1,3 @@ --- ======== --- PROTOCOL --- ======== - -- create the database functions CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; @@ -11,9 +7,6 @@ CREATE PROTOCOL s3 ( readfunc = read_from_s3 ); --- Check out the catalog table -select * from pg_extprotocol; - drop external table s3example; create READABLE external table s3example (date text, time text, open float, high float, low float, volume int) location('s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset1/normal/ config=/home/gpadmin/s3.conf') FORMAT 'text' ( DELIMITER ',' NULL '') LOG ERRORS SEGMENT REJECT LIMIT 5; @@ -21,9 +14,6 @@ create READABLE external table s3example (date text, time text, open float, high SELECT count(*) FROM s3example; SELECT gp_read_error_log('s3example'); --- ======= --- CLEANUP --- ======= DROP EXTERNAL TABLE s3example; DROP PROTOCOL s3; diff --git a/gpAux/extensions/gps3ext/regress/regress_1.03.sql b/gpAux/extensions/gps3ext/regress/input/1_03_bad_data.source similarity index 83% rename from gpAux/extensions/gps3ext/regress/regress_1.03.sql rename to gpAux/extensions/gps3ext/regress/input/1_03_bad_data.source index 3b0162914a22..e2cf817e9862 100644 --- a/gpAux/extensions/gps3ext/regress/regress_1.03.sql +++ b/gpAux/extensions/gps3ext/regress/input/1_03_bad_data.source @@ -1,7 +1,3 @@ --- ======== --- PROTOCOL --- ======== - -- create the database functions CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; @@ -11,20 +7,16 @@ CREATE PROTOCOL s3 ( readfunc = read_from_s3 ); --- Check out the catalog table -select * from pg_extprotocol; - drop external table s3example; create READABLE external table s3example (date text, time text, open float, high float, low float, volume int) location('s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset1/baddata/ config=/home/gpadmin/s3.conf') format 'csv' LOG ERRORS SEGMENT REJECT LIMIT 5; SELECT count(*) FROM s3example; +-- start_ignore SELECT gp_read_error_log('s3example'); +-- end_ignore --- ======= --- CLEANUP --- ======= DROP EXTERNAL TABLE s3example; DROP PROTOCOL s3; diff --git a/gpAux/extensions/gps3ext/regress/regress_1.04.sql b/gpAux/extensions/gps3ext/regress/input/1_04_empty_prefix.source similarity index 83% rename from gpAux/extensions/gps3ext/regress/regress_1.04.sql rename to gpAux/extensions/gps3ext/regress/input/1_04_empty_prefix.source index da97f97b7894..4142130a8340 100644 --- a/gpAux/extensions/gps3ext/regress/regress_1.04.sql +++ b/gpAux/extensions/gps3ext/regress/input/1_04_empty_prefix.source @@ -1,7 +1,3 @@ --- ======== --- PROTOCOL --- ======== - -- create the database functions CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; @@ -11,9 +7,6 @@ CREATE PROTOCOL s3 ( readfunc = read_from_s3 ); --- Check out the catalog table -select * from pg_extprotocol; - drop external table s3example; create READABLE external table s3example (date text, time text, open float, high float, low float, volume int) location('s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset2/emptyfile/ config=/home/gpadmin/s3.conf') format 'csv' LOG ERRORS SEGMENT REJECT LIMIT 5; @@ -21,9 +14,6 @@ create READABLE external table s3example (date text, time text, open float, high SELECT count(*) FROM s3example; SELECT gp_read_error_log('s3example'); --- ======= --- CLEANUP --- ======= DROP EXTERNAL TABLE s3example; DROP PROTOCOL s3; diff --git a/gpAux/extensions/gps3ext/regress/regress_1.05.sql b/gpAux/extensions/gps3ext/regress/input/1_05_one_line.source similarity index 82% rename from gpAux/extensions/gps3ext/regress/regress_1.05.sql rename to gpAux/extensions/gps3ext/regress/input/1_05_one_line.source index 62dee1917aea..994f1b4ed67c 100644 --- a/gpAux/extensions/gps3ext/regress/regress_1.05.sql +++ b/gpAux/extensions/gps3ext/regress/input/1_05_one_line.source @@ -1,7 +1,3 @@ --- ======== --- PROTOCOL --- ======== - -- create the database functions CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; @@ -11,18 +7,12 @@ CREATE PROTOCOL s3 ( readfunc = read_from_s3 ); --- Check out the catalog table -select * from pg_extprotocol; - drop external table s3example; create READABLE external table s3example (date text, time text, open float, high float, low float, volume int) location('s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset2/oneline/ config=/home/gpadmin/s3.conf') format 'csv'; SELECT count(*) FROM s3example; --- ======= --- CLEANUP --- ======= DROP EXTERNAL TABLE s3example; DROP PROTOCOL s3; diff --git a/gpAux/extensions/gps3ext/regress/regress_1.06.sql b/gpAux/extensions/gps3ext/regress/input/1_06_1correct_1wrong.source similarity index 84% rename from gpAux/extensions/gps3ext/regress/regress_1.06.sql rename to gpAux/extensions/gps3ext/regress/input/1_06_1correct_1wrong.source index bf714bd81be4..b00599c10b57 100644 --- a/gpAux/extensions/gps3ext/regress/regress_1.06.sql +++ b/gpAux/extensions/gps3ext/regress/input/1_06_1correct_1wrong.source @@ -1,7 +1,3 @@ --- ======== --- PROTOCOL --- ======== - -- create the database functions CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; @@ -11,19 +7,15 @@ CREATE PROTOCOL s3 ( readfunc = read_from_s3 ); --- Check out the catalog table -select * from pg_extprotocol; - drop external table s3example; create READABLE external table s3example (date text, time text, open float, high float, low float, volume int) location('s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset2/1correct1wrong/ config=/home/gpadmin/s3.conf') format 'csv' LOG ERRORS SEGMENT REJECT LIMIT 5; SELECT count(*) FROM s3example; +-- start_ignore SELECT gp_read_error_log('s3example'); +-- end_ignore --- ======= --- CLEANUP --- ======= DROP EXTERNAL TABLE s3example; DROP PROTOCOL s3; diff --git a/gpAux/extensions/gps3ext/regress/regress_1.07.sql b/gpAux/extensions/gps3ext/regress/input/1_07_huge_bad_data.source similarity index 56% rename from gpAux/extensions/gps3ext/regress/regress_1.07.sql rename to gpAux/extensions/gps3ext/regress/input/1_07_huge_bad_data.source index b9864f2c7c78..46891758a019 100644 --- a/gpAux/extensions/gps3ext/regress/regress_1.07.sql +++ b/gpAux/extensions/gps3ext/regress/input/1_07_huge_bad_data.source @@ -1,7 +1,3 @@ --- ======== --- PROTOCOL --- ======== - -- create the database functions CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; @@ -11,18 +7,11 @@ CREATE PROTOCOL s3 ( readfunc = read_from_s3 ); --- Check out the catalog table -select * from pg_extprotocol; - drop external table s3example; --- create READABLE external table s3example (Year text, Month text, DayofMonth text, DayOfWeek text, DepTime text, CRSDepTime text, ArrTime text,CRSArrTime text, UniqueCarrier text, FlightNum text,TailNum text, ActualElapsedTime text, CRSElapsedTime text, AirTime text, ArrDelay text, DepDelay text, Origin text, Dest text, Distance text, TaxiIn text, TaxiOut text, Cancelled text, CancellationCode text, Diverted text, CarrierDelay text, WeatherDelay text, NASDelay text, SecurityDelay text, LateAircraftDelay text) location('s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset2/hugefile config=/home/gpadmin/s3.conf') format 'csv' LOG ERRORS SEGMENT REJECT LIMIT 100 PERCENT; create READABLE external table s3example (Year text, Month text, DayofMonth text, DayOfWeek text, DepTime text, CRSDepTime text, ArrTime text,CRSArrTime text, UniqueCarrier text, FlightNum text,TailNum text, ActualElapsedTime text, CRSElapsedTime text, AirTime text, ArrDelay text, DepDelay text, Origin text, Dest text, Distance text, TaxiIn text, TaxiOut text, Cancelled text, CancellationCode text, Diverted text, CarrierDelay text, WeatherDelay text, NASDelay text, SecurityDelay text, LateAircraftDelay text) location('s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset2/hugefile/ config=/home/gpadmin/s3.conf') format 'csv' SEGMENT REJECT LIMIT 100 PERCENT; SELECT count(*) FROM s3example; --- ======= --- CLEANUP --- ======= DROP EXTERNAL TABLE s3example; DROP PROTOCOL s3; diff --git a/gpAux/extensions/gps3ext/regress/regress_1.08.sql b/gpAux/extensions/gps3ext/regress/input/1_08_huge_correct_data.source similarity index 88% rename from gpAux/extensions/gps3ext/regress/regress_1.08.sql rename to gpAux/extensions/gps3ext/regress/input/1_08_huge_correct_data.source index ceb81c899630..efcbe5631066 100644 --- a/gpAux/extensions/gps3ext/regress/regress_1.08.sql +++ b/gpAux/extensions/gps3ext/regress/input/1_08_huge_correct_data.source @@ -1,7 +1,3 @@ --- ======== --- PROTOCOL --- ======== - -- create the database functions CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; @@ -11,17 +7,11 @@ CREATE PROTOCOL s3 ( readfunc = read_from_s3 ); --- Check out the catalog table -select * from pg_extprotocol; - drop external table s3example; create READABLE external table s3example (Year text, Month text, DayofMonth text, DayOfWeek text, DepTime text, CRSDepTime text, ArrTime text,CRSArrTime text, UniqueCarrier text, FlightNum text,TailNum text, ActualElapsedTime text, CRSElapsedTime text, AirTime text, ArrDelay text, DepDelay text, Origin text, Dest text, Distance text, TaxiIn text, TaxiOut text, Cancelled text, CancellationCode text, Diverted text, CarrierDelay text, WeatherDelay text, NASDelay text, SecurityDelay text, LateAircraftDelay text) location('s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset2/hugefile_correct_data/ config=/home/gpadmin/s3.conf') format 'csv' SEGMENT REJECT LIMIT 100 PERCENT; SELECT count(*) FROM s3example; --- ======= --- CLEANUP --- ======= DROP EXTERNAL TABLE s3example; DROP PROTOCOL s3; diff --git a/gpAux/extensions/gps3ext/regress/regress_1.09.sql b/gpAux/extensions/gps3ext/regress/input/1_09_partition.source similarity index 90% rename from gpAux/extensions/gps3ext/regress/regress_1.09.sql rename to gpAux/extensions/gps3ext/regress/input/1_09_partition.source index acf2809082eb..ffb398753790 100644 --- a/gpAux/extensions/gps3ext/regress/regress_1.09.sql +++ b/gpAux/extensions/gps3ext/regress/input/1_09_partition.source @@ -1,7 +1,3 @@ --- ======== --- PROTOCOL --- ======== - -- create the database functions CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; @@ -11,9 +7,6 @@ CREATE PROTOCOL s3 ( readfunc = read_from_s3 ); --- Check out the catalog table -select * from pg_extprotocol; - drop external table s3example; CREATE TABLE stock (date text, time text, open float, high float, low float, volume int) DISTRIBUTED BY (date) PARTITION BY RANGE (volume) @@ -35,9 +28,6 @@ ALTER TABLE stock EXCHANGE PARTITION FOR (0) WITH TABLE ext_stock000 WITHOUT VAL SELECT count(*) FROM stock_1_prt_stock000; SELECT count(*) FROM stock; --- ======= --- CLEANUP --- ======= DROP TABLE ext_stock000; DROP TABLE stock; diff --git a/gpAux/extensions/gps3ext/regress/regress_1.10.sql b/gpAux/extensions/gps3ext/regress/input/1_10_all_regions.source similarity index 93% rename from gpAux/extensions/gps3ext/regress/regress_1.10.sql rename to gpAux/extensions/gps3ext/regress/input/1_10_all_regions.source index 54b3106ce4d5..8264b05542cf 100644 --- a/gpAux/extensions/gps3ext/regress/regress_1.10.sql +++ b/gpAux/extensions/gps3ext/regress/input/1_10_all_regions.source @@ -1,7 +1,3 @@ --- ======== --- PROTOCOL --- ======== - -- create the database functions CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; @@ -11,10 +7,6 @@ CREATE PROTOCOL s3 ( readfunc = read_from_s3 ); --- Check out the catalog table -select * from pg_extprotocol; - --- ======== drop external table s3example; create READABLE external table s3example (date text, time text, open float, high float, @@ -24,7 +16,6 @@ create READABLE external table s3example (date text, time text, open float, high SELECT sum(open) FROM s3example; --- ======== drop external table s3example; create READABLE external table s3example (date text, time text, open float, high float, @@ -34,7 +25,6 @@ create READABLE external table s3example (date text, time text, open float, high SELECT sum(open) FROM s3example; --- ======== drop external table s3example; create READABLE external table s3example (date text, time text, open float, high float, @@ -44,7 +34,6 @@ create READABLE external table s3example (date text, time text, open float, high SELECT sum(open) FROM s3example; --- ======== drop external table s3example; create READABLE external table s3example (date text, time text, open float, high float, @@ -54,7 +43,6 @@ create READABLE external table s3example (date text, time text, open float, high SELECT sum(open) FROM s3example; --- ======== drop external table s3example; create READABLE external table s3example (date text, time text, open float, high float, @@ -64,7 +52,6 @@ create READABLE external table s3example (date text, time text, open float, high SELECT sum(open) FROM s3example; --- ======== drop external table s3example; create READABLE external table s3example (date text, time text, open float, high float, @@ -74,7 +61,6 @@ create READABLE external table s3example (date text, time text, open float, high SELECT sum(open) FROM s3example; --- ======== drop external table s3example; create READABLE external table s3example (date text, time text, open float, high float, @@ -84,7 +70,6 @@ create READABLE external table s3example (date text, time text, open float, high SELECT sum(open) FROM s3example; --- ======== drop external table s3example; create READABLE external table s3example (date text, time text, open float, high float, @@ -94,7 +79,6 @@ create READABLE external table s3example (date text, time text, open float, high SELECT sum(open) FROM s3example; --- ======== drop external table s3example; create READABLE external table s3example (date text, time text, open float, high float, @@ -104,9 +88,6 @@ create READABLE external table s3example (date text, time text, open float, high SELECT sum(open) FROM s3example; --- ======= --- CLEANUP --- ======= DROP EXTERNAL TABLE s3example; DROP PROTOCOL s3; diff --git a/gpAux/extensions/gps3ext/regress/regress_1.11.sql b/gpAux/extensions/gps3ext/regress/input/1_11_gzipped_data.source similarity index 91% rename from gpAux/extensions/gps3ext/regress/regress_1.11.sql rename to gpAux/extensions/gps3ext/regress/input/1_11_gzipped_data.source index 9fd4afcb551d..8cecb4a1f880 100644 --- a/gpAux/extensions/gps3ext/regress/regress_1.11.sql +++ b/gpAux/extensions/gps3ext/regress/input/1_11_gzipped_data.source @@ -1,7 +1,3 @@ --- ======== --- PROTOCOL --- ======== - -- create the database functions CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; @@ -11,9 +7,6 @@ CREATE PROTOCOL s3 ( readfunc = read_from_s3 ); --- Check out the catalog table -select * from pg_extprotocol; - drop external table s3example; create READABLE external table s3example (date text, time text, open float, high float, low float, volume int) location('s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset1/gzipped_normal1/ config=/home/gpadmin/s3.conf') FORMAT 'csv'; @@ -27,9 +20,6 @@ create READABLE external table s3example (Year text, Month text, DayofMonth text SELECT count(*) FROM s3example; --- ======= --- CLEANUP --- ======= DROP EXTERNAL TABLE s3example; DROP PROTOCOL s3; diff --git a/gpAux/extensions/gps3ext/regress/regress_1.12.sql b/gpAux/extensions/gps3ext/regress/input/1_12_no_prefix.source similarity index 88% rename from gpAux/extensions/gps3ext/regress/regress_1.12.sql rename to gpAux/extensions/gps3ext/regress/input/1_12_no_prefix.source index 19fcd9cde113..f6dc62d88c4a 100644 --- a/gpAux/extensions/gps3ext/regress/regress_1.12.sql +++ b/gpAux/extensions/gps3ext/regress/input/1_12_no_prefix.source @@ -1,7 +1,3 @@ --- ======== --- PROTOCOL --- ======== - -- create the database functions CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; @@ -11,10 +7,6 @@ CREATE PROTOCOL s3 ( readfunc = read_from_s3 ); --- Check out the catalog table -select * from pg_extprotocol; - --- ======== drop external table s3example; create READABLE external table s3example (date text, time text, open float, high float, @@ -24,7 +16,6 @@ create READABLE external table s3example (date text, time text, open float, high SELECT sum(open) FROM s3example; --- ======== drop external table s3example; create READABLE external table s3example (date text, time text, open float, high float, @@ -34,7 +25,6 @@ create READABLE external table s3example (date text, time text, open float, high SELECT sum(open) FROM s3example; --- ======== drop external table s3example; create READABLE external table s3example (date text, time text, open float, high float, @@ -44,9 +34,6 @@ create READABLE external table s3example (date text, time text, open float, high SELECT sum(open) FROM s3example; --- ======= --- CLEANUP --- ======= DROP EXTERNAL TABLE s3example; DROP PROTOCOL s3; diff --git a/gpAux/extensions/gps3ext/regress/regress_2.01.sql b/gpAux/extensions/gps3ext/regress/input/2_01_invalid_syntax.source similarity index 82% rename from gpAux/extensions/gps3ext/regress/regress_2.01.sql rename to gpAux/extensions/gps3ext/regress/input/2_01_invalid_syntax.source index 9c1bb145dc1f..36911d240cfa 100644 --- a/gpAux/extensions/gps3ext/regress/regress_2.01.sql +++ b/gpAux/extensions/gps3ext/regress/input/2_01_invalid_syntax.source @@ -1,7 +1,3 @@ --- ======== --- PROTOCOL --- ======== - -- create the database functions CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; @@ -11,18 +7,12 @@ CREATE PROTOCOL s3 ( readfunc = read_from_s3 ); --- Check out the catalog table -select * from pg_extprotocol; - drop external table s3example; create READABLE external table s3example (date float, time float, open float, high float, low float, volume int) location('s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset1/normal/ config=/home/gpadmin/s3.conf') format 'csv'; SELECT count(*) FROM s3example; --- ======= --- CLEANUP --- ======= DROP EXTERNAL TABLE s3example; DROP PROTOCOL s3; diff --git a/gpAux/extensions/gps3ext/regress/regress_2.02.sql b/gpAux/extensions/gps3ext/regress/input/2_02_invalid_region.source similarity index 81% rename from gpAux/extensions/gps3ext/regress/regress_2.02.sql rename to gpAux/extensions/gps3ext/regress/input/2_02_invalid_region.source index 6e374a181658..bde7009241bf 100644 --- a/gpAux/extensions/gps3ext/regress/regress_2.02.sql +++ b/gpAux/extensions/gps3ext/regress/input/2_02_invalid_region.source @@ -1,7 +1,3 @@ --- ======== --- PROTOCOL --- ======== - -- create the database functions CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; @@ -11,18 +7,12 @@ CREATE PROTOCOL s3 ( readfunc = read_from_s3 ); --- Check out the catalog table -select * from pg_extprotocol; - drop external table s3example; create READABLE external table s3example (date text, time text, open float, high float, low float, volume int) location('s3://neverland.amazonaws.com/wherever/smalldata/ config=/home/gpadmin/s3.conf') format 'csv'; SELECT count(*) FROM s3example; --- ======= --- CLEANUP --- ======= DROP EXTERNAL TABLE s3example; DROP PROTOCOL s3; diff --git a/gpAux/extensions/gps3ext/regress/regress_2.03.sql b/gpAux/extensions/gps3ext/regress/input/2_03_invalid_config.source similarity index 81% rename from gpAux/extensions/gps3ext/regress/regress_2.03.sql rename to gpAux/extensions/gps3ext/regress/input/2_03_invalid_config.source index 1e83085bf990..ce41af75dc2e 100644 --- a/gpAux/extensions/gps3ext/regress/regress_2.03.sql +++ b/gpAux/extensions/gps3ext/regress/input/2_03_invalid_config.source @@ -1,7 +1,3 @@ --- ======== --- PROTOCOL --- ======== - -- create the database functions CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; @@ -11,18 +7,12 @@ CREATE PROTOCOL s3 ( readfunc = read_from_s3 ); --- Check out the catalog table -select * from pg_extprotocol; - drop external table s3example; create READABLE external table s3example (date text, time text, open float, high float, low float, volume int) location('s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset1/normal/') format 'csv'; SELECT count(*) FROM s3example; --- ======= --- CLEANUP --- ======= DROP EXTERNAL TABLE s3example; DROP PROTOCOL s3; diff --git a/gpAux/extensions/gps3ext/regress/regress_2.04.sql b/gpAux/extensions/gps3ext/regress/input/2_04_invalid_header.source similarity index 82% rename from gpAux/extensions/gps3ext/regress/regress_2.04.sql rename to gpAux/extensions/gps3ext/regress/input/2_04_invalid_header.source index 430cbf11fb39..ff73619ba2f2 100644 --- a/gpAux/extensions/gps3ext/regress/regress_2.04.sql +++ b/gpAux/extensions/gps3ext/regress/input/2_04_invalid_header.source @@ -1,7 +1,3 @@ --- ======== --- PROTOCOL --- ======== - -- create the database functions CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; @@ -11,18 +7,12 @@ CREATE PROTOCOL s3 ( readfunc = read_from_s3 ); --- Check out the catalog table -select * from pg_extprotocol; - drop external table s3example; create READABLE external table s3example (date text, time text, open float, high float, low float, volume int) location('s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset2/csv_with_header/ config=/home/gpadmin/s3.conf') format 'csv'; SELECT count(*) FROM s3example; --- ======= --- CLEANUP --- ======= DROP EXTERNAL TABLE s3example; DROP PROTOCOL s3; diff --git a/gpAux/extensions/gps3ext/regress/output/1_01_normal.source b/gpAux/extensions/gps3ext/regress/output/1_01_normal.source new file mode 100644 index 000000000000..da242a2570e6 --- /dev/null +++ b/gpAux/extensions/gps3ext/regress/output/1_01_normal.source @@ -0,0 +1,31 @@ +-- create the database functions +CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS + '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; +-- declare the protocol name along with in/out funcs +CREATE PROTOCOL s3 ( + readfunc = read_from_s3 +); +drop external table s3example; +ERROR: table "s3example" does not exist +create READABLE external table s3example (date text, time text, open float, high float, + low float, volume int) location('s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset1/normal/ config=/home/gpadmin/s3.conf') FORMAT 'csv'; +SELECT count(*) FROM s3example; + count +---------- + 31033039 +(1 row) + +SELECT sum(open) FROM s3example; + sum +------------------ + 1490754474.37251 +(1 row) + +SELECT avg(open) FROM s3example; + avg +------------------ + 48.0376567171687 +(1 row) + +DROP EXTERNAL TABLE s3example; +DROP PROTOCOL s3; diff --git a/gpAux/extensions/gps3ext/regress/output/1_02_log_error.source b/gpAux/extensions/gps3ext/regress/output/1_02_log_error.source new file mode 100644 index 000000000000..4cdb946e2dd1 --- /dev/null +++ b/gpAux/extensions/gps3ext/regress/output/1_02_log_error.source @@ -0,0 +1,24 @@ +-- create the database functions +CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS + '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; +-- declare the protocol name along with in/out funcs +CREATE PROTOCOL s3 ( + readfunc = read_from_s3 +); +drop external table s3example; +ERROR: table "s3example" does not exist +create READABLE external table s3example (date text, time text, open float, high float, + low float, volume int) location('s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset1/normal/ config=/home/gpadmin/s3.conf') FORMAT 'text' ( DELIMITER ',' NULL '') LOG ERRORS SEGMENT REJECT LIMIT 5; +SELECT count(*) FROM s3example; + count +---------- + 31033039 +(1 row) + +SELECT gp_read_error_log('s3example'); + gp_read_error_log +------------------- +(0 rows) + +DROP EXTERNAL TABLE s3example; +DROP PROTOCOL s3; diff --git a/gpAux/extensions/gps3ext/regress/output/1_03_bad_data.source b/gpAux/extensions/gps3ext/regress/output/1_03_bad_data.source new file mode 100644 index 000000000000..32675073a1b0 --- /dev/null +++ b/gpAux/extensions/gps3ext/regress/output/1_03_bad_data.source @@ -0,0 +1,30 @@ +-- create the database functions +CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS + '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; +-- declare the protocol name along with in/out funcs +CREATE PROTOCOL s3 ( + readfunc = read_from_s3 +); +drop external table s3example; +ERROR: table "s3example" does not exist +create READABLE external table s3example (date text, time text, open float, high float, + low float, volume int) location('s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset1/baddata/ config=/home/gpadmin/s3.conf') format 'csv' LOG ERRORS SEGMENT REJECT LIMIT 5; +SELECT count(*) FROM s3example; +NOTICE: Found 3 data formatting errors (3 or more input rows). Rejected related input data. + count +------- + 7 +(1 row) + +-- start_ignore +SELECT gp_read_error_log('s3example'); + gp_read_error_log +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + ("Mon Jul 04 20:11:08.360614 2016 PDT",s3example,"s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset1/baddata/ config=/home/gpadmin/s3.conf",3,,"missing data for column ""low""","09/28/2009,09:30:06,35.49,35.37",) + ("Mon Jul 04 20:11:08.359313 2016 PDT",s3example,"s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset1/baddata/ config=/home/gpadmin/s3.conf",2,,"missing data for column ""volume""","10/05/2009,36.19,36.18,36.2,100",) + ("Mon Jul 04 20:11:08.359313 2016 PDT",s3example,"s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset1/baddata/ config=/home/gpadmin/s3.conf",4,,"missing data for column ""low""","10/05/2009,11:56:50,36.21,200",) +(3 rows) + +-- end_ignore +DROP EXTERNAL TABLE s3example; +DROP PROTOCOL s3; diff --git a/gpAux/extensions/gps3ext/regress/output/1_04_empty_prefix.source b/gpAux/extensions/gps3ext/regress/output/1_04_empty_prefix.source new file mode 100644 index 000000000000..f137391f38b6 --- /dev/null +++ b/gpAux/extensions/gps3ext/regress/output/1_04_empty_prefix.source @@ -0,0 +1,24 @@ +-- create the database functions +CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS + '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; +-- declare the protocol name along with in/out funcs +CREATE PROTOCOL s3 ( + readfunc = read_from_s3 +); +drop external table s3example; +ERROR: table "s3example" does not exist +create READABLE external table s3example (date text, time text, open float, high float, + low float, volume int) location('s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset2/emptyfile/ config=/home/gpadmin/s3.conf') format 'csv' LOG ERRORS SEGMENT REJECT LIMIT 5; +SELECT count(*) FROM s3example; + count +------- + 0 +(1 row) + +SELECT gp_read_error_log('s3example'); + gp_read_error_log +------------------- +(0 rows) + +DROP EXTERNAL TABLE s3example; +DROP PROTOCOL s3; diff --git a/gpAux/extensions/gps3ext/regress/output/1_05_one_line.source b/gpAux/extensions/gps3ext/regress/output/1_05_one_line.source new file mode 100644 index 000000000000..f9580d5f51e1 --- /dev/null +++ b/gpAux/extensions/gps3ext/regress/output/1_05_one_line.source @@ -0,0 +1,19 @@ +-- create the database functions +CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS + '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; +-- declare the protocol name along with in/out funcs +CREATE PROTOCOL s3 ( + readfunc = read_from_s3 +); +drop external table s3example; +ERROR: table "s3example" does not exist +create READABLE external table s3example (date text, time text, open float, high float, + low float, volume int) location('s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset2/oneline/ config=/home/gpadmin/s3.conf') format 'csv'; +SELECT count(*) FROM s3example; + count +------- + 1 +(1 row) + +DROP EXTERNAL TABLE s3example; +DROP PROTOCOL s3; diff --git a/gpAux/extensions/gps3ext/regress/output/1_06_1correct_1wrong.source b/gpAux/extensions/gps3ext/regress/output/1_06_1correct_1wrong.source new file mode 100644 index 000000000000..b6a88200e744 --- /dev/null +++ b/gpAux/extensions/gps3ext/regress/output/1_06_1correct_1wrong.source @@ -0,0 +1,28 @@ +-- create the database functions +CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS + '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; +-- declare the protocol name along with in/out funcs +CREATE PROTOCOL s3 ( + readfunc = read_from_s3 +); +drop external table s3example; +ERROR: table "s3example" does not exist +create READABLE external table s3example (date text, time text, open float, high float, + low float, volume int) location('s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset2/1correct1wrong/ config=/home/gpadmin/s3.conf') format 'csv' LOG ERRORS SEGMENT REJECT LIMIT 5; +SELECT count(*) FROM s3example; +NOTICE: Found 1 data formatting errors (1 or more input rows). Rejected related input data. + count +------- + 1 +(1 row) + +-- start_ignore +SELECT gp_read_error_log('s3example'); + gp_read_error_log +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + ("Mon Jul 04 20:11:10.225613 2016 PDT",s3example,"s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset2/1correct1wrong/ config=/home/gpadmin/s3.conf",2,,"extra data after last expected column","whatever,09/28/2009,09:10:37,35.6,35.29,35.75,150,wherever",) +(1 row) + +-- end_ignore +DROP EXTERNAL TABLE s3example; +DROP PROTOCOL s3; diff --git a/gpAux/extensions/gps3ext/regress/output/1_07_huge_bad_data.source b/gpAux/extensions/gps3ext/regress/output/1_07_huge_bad_data.source new file mode 100644 index 000000000000..ab00a3ef7e19 --- /dev/null +++ b/gpAux/extensions/gps3ext/regress/output/1_07_huge_bad_data.source @@ -0,0 +1,19 @@ +-- create the database functions +CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS + '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; +-- declare the protocol name along with in/out funcs +CREATE PROTOCOL s3 ( + readfunc = read_from_s3 +); +drop external table s3example; +ERROR: table "s3example" does not exist +create READABLE external table s3example (Year text, Month text, DayofMonth text, DayOfWeek text, DepTime text, CRSDepTime text, ArrTime text,CRSArrTime text, UniqueCarrier text, FlightNum text,TailNum text, ActualElapsedTime text, CRSElapsedTime text, AirTime text, ArrDelay text, DepDelay text, Origin text, Dest text, Distance text, TaxiIn text, TaxiOut text, Cancelled text, CancellationCode text, Diverted text, CarrierDelay text, WeatherDelay text, NASDelay text, SecurityDelay text, LateAircraftDelay text) location('s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset2/hugefile/ config=/home/gpadmin/s3.conf') format 'csv' SEGMENT REJECT LIMIT 100 PERCENT; +SELECT count(*) FROM s3example; +NOTICE: Found 2880938 data formatting errors (2880938 or more input rows). Rejected related input data. + count +----------- + 120654053 +(1 row) + +DROP EXTERNAL TABLE s3example; +DROP PROTOCOL s3; diff --git a/gpAux/extensions/gps3ext/regress/output/1_08_huge_correct_data.source b/gpAux/extensions/gps3ext/regress/output/1_08_huge_correct_data.source new file mode 100644 index 000000000000..cc612ed77e3c --- /dev/null +++ b/gpAux/extensions/gps3ext/regress/output/1_08_huge_correct_data.source @@ -0,0 +1,18 @@ +-- create the database functions +CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS + '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; +-- declare the protocol name along with in/out funcs +CREATE PROTOCOL s3 ( + readfunc = read_from_s3 +); +drop external table s3example; +ERROR: table "s3example" does not exist +create READABLE external table s3example (Year text, Month text, DayofMonth text, DayOfWeek text, DepTime text, CRSDepTime text, ArrTime text,CRSArrTime text, UniqueCarrier text, FlightNum text,TailNum text, ActualElapsedTime text, CRSElapsedTime text, AirTime text, ArrDelay text, DepDelay text, Origin text, Dest text, Distance text, TaxiIn text, TaxiOut text, Cancelled text, CancellationCode text, Diverted text, CarrierDelay text, WeatherDelay text, NASDelay text, SecurityDelay text, LateAircraftDelay text) location('s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset2/hugefile_correct_data/ config=/home/gpadmin/s3.conf') format 'csv' SEGMENT REJECT LIMIT 100 PERCENT; +SELECT count(*) FROM s3example; + count +----------- + 124595613 +(1 row) + +DROP EXTERNAL TABLE s3example; +DROP PROTOCOL s3; diff --git a/gpAux/extensions/gps3ext/regress/output/1_09_partition.source b/gpAux/extensions/gps3ext/regress/output/1_09_partition.source new file mode 100644 index 000000000000..2a4d05383c58 --- /dev/null +++ b/gpAux/extensions/gps3ext/regress/output/1_09_partition.source @@ -0,0 +1,40 @@ +-- create the database functions +CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS +'$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; +-- declare the protocol name along with in/out funcs +CREATE PROTOCOL s3 ( + readfunc = read_from_s3 +); +drop external table s3example; +ERROR: table "s3example" does not exist +CREATE TABLE stock (date text, time text, open float, high float, low float, volume int) DISTRIBUTED BY (date) PARTITION BY RANGE (volume) +( + PARTITION stock10000 START (10000) INCLUSIVE, + PARTITION stock20000 START (20000) INCLUSIVE, + PARTITION stock30000 START (30000) INCLUSIVE +); +NOTICE: CREATE TABLE will create partition "stock_1_prt_stock10000" for table "stock" +NOTICE: CREATE TABLE will create partition "stock_1_prt_stock20000" for table "stock" +NOTICE: CREATE TABLE will create partition "stock_1_prt_stock30000" for table "stock" +INSERT INTO stock (date, time, open, high, low, volume) VALUES (03/08/2011, 094022, 35.25, 35.24, 35.29, 20001); +create READABLE external table ext_stock000 (date text, time text, open float, high float, + low float, volume int) location('s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset1/normal/ config=/home/gpadmin/s3.conf') FORMAT 'csv'; +ALTER TABLE stock ADD PARTITION stock000 START (0) INCLUSIVE END (10000) EXCLUSIVE; +NOTICE: CREATE TABLE will create partition "stock_1_prt_stock000" for table "stock" +ALTER TABLE stock EXCHANGE PARTITION FOR (0) WITH TABLE ext_stock000 WITHOUT VALIDATION; +NOTICE: exchanged partition "stock000" of relation "stock" with relation "ext_stock000" +SELECT count(*) FROM stock_1_prt_stock000; + count +---------- + 31024410 +(1 row) + +SELECT count(*) FROM stock; + count +---------- + 31024411 +(1 row) + +DROP TABLE ext_stock000; +DROP TABLE stock; +DROP PROTOCOL s3; diff --git a/gpAux/extensions/gps3ext/regress/output/1_10_all_regions.source b/gpAux/extensions/gps3ext/regress/output/1_10_all_regions.source new file mode 100644 index 000000000000..2c1aadba9c28 --- /dev/null +++ b/gpAux/extensions/gps3ext/regress/output/1_10_all_regions.source @@ -0,0 +1,235 @@ +-- create the database functions +CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS + '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; +-- declare the protocol name along with in/out funcs +CREATE PROTOCOL s3 ( + readfunc = read_from_s3 +); +drop external table s3example; +ERROR: table "s3example" does not exist +create READABLE external table s3example (date text, time text, open float, high float, + low float, volume int) location('s3://s3-ap-northeast-1.amazonaws.com/apnortheast1.s3test.pivotal.io/small17/ config=/home/gpadmin/s3.conf') FORMAT 'csv'; +\d s3example + External table "public.s3example" + Column | Type | Modifiers +--------+------------------+----------- + date | text | + time | text | + open | double precision | + high | double precision | + low | double precision | + volume | integer | +Type: readable +Encoding: UTF8 +Format type: csv +Format options: delimiter ',' null '' escape '"' quote '"' +External location: "s3://s3-ap-northeast-1.amazonaws.com/apnortheast1.s3test.pivotal.io/small17/ config=/home/gpadmin/s3.conf" + +SELECT sum(open) FROM s3example; + sum +------------------ + 71676418.9189046 +(1 row) + +drop external table s3example; +create READABLE external table s3example (date text, time text, open float, high float, + low float, volume int) location('s3://s3-ap-northeast-2.amazonaws.com/apnortheast2.s3test.pivotal.io/small17/ config=/home/gpadmin/s3.conf') FORMAT 'csv'; +\d s3example + External table "public.s3example" + Column | Type | Modifiers +--------+------------------+----------- + date | text | + time | text | + open | double precision | + high | double precision | + low | double precision | + volume | integer | +Type: readable +Encoding: UTF8 +Format type: csv +Format options: delimiter ',' null '' escape '"' quote '"' +External location: "s3://s3-ap-northeast-2.amazonaws.com/apnortheast2.s3test.pivotal.io/small17/ config=/home/gpadmin/s3.conf" + +SELECT sum(open) FROM s3example; + sum +------------------ + 71676418.9189046 +(1 row) + +drop external table s3example; +create READABLE external table s3example (date text, time text, open float, high float, + low float, volume int) location('s3://s3-ap-southeast-1.amazonaws.com/apsoutheast1.s3test.pivotal.io/small17/ config=/home/gpadmin/s3.conf') FORMAT 'csv'; +\d s3example + External table "public.s3example" + Column | Type | Modifiers +--------+------------------+----------- + date | text | + time | text | + open | double precision | + high | double precision | + low | double precision | + volume | integer | +Type: readable +Encoding: UTF8 +Format type: csv +Format options: delimiter ',' null '' escape '"' quote '"' +External location: "s3://s3-ap-southeast-1.amazonaws.com/apsoutheast1.s3test.pivotal.io/small17/ config=/home/gpadmin/s3.conf" + +SELECT sum(open) FROM s3example; + sum +------------------ + 71676418.9189046 +(1 row) + +drop external table s3example; +create READABLE external table s3example (date text, time text, open float, high float, + low float, volume int) location('s3://s3-ap-southeast-2.amazonaws.com/apsoutheast2.s3test.pivotal.io/small17/ config=/home/gpadmin/s3.conf') FORMAT 'csv'; +\d s3example + External table "public.s3example" + Column | Type | Modifiers +--------+------------------+----------- + date | text | + time | text | + open | double precision | + high | double precision | + low | double precision | + volume | integer | +Type: readable +Encoding: UTF8 +Format type: csv +Format options: delimiter ',' null '' escape '"' quote '"' +External location: "s3://s3-ap-southeast-2.amazonaws.com/apsoutheast2.s3test.pivotal.io/small17/ config=/home/gpadmin/s3.conf" + +SELECT sum(open) FROM s3example; + sum +------------------ + 71676418.9189046 +(1 row) + +drop external table s3example; +create READABLE external table s3example (date text, time text, open float, high float, + low float, volume int) location('s3://s3-eu-central-1.amazonaws.com/eucentral1.s3test.pivotal.io/small17/ config=/home/gpadmin/s3.conf') FORMAT 'csv'; +\d s3example + External table "public.s3example" + Column | Type | Modifiers +--------+------------------+----------- + date | text | + time | text | + open | double precision | + high | double precision | + low | double precision | + volume | integer | +Type: readable +Encoding: UTF8 +Format type: csv +Format options: delimiter ',' null '' escape '"' quote '"' +External location: "s3://s3-eu-central-1.amazonaws.com/eucentral1.s3test.pivotal.io/small17/ config=/home/gpadmin/s3.conf" + +SELECT sum(open) FROM s3example; + sum +------------------ + 71676418.9189046 +(1 row) + +drop external table s3example; +create READABLE external table s3example (date text, time text, open float, high float, + low float, volume int) location('s3://s3-eu-west-1.amazonaws.com/euwest1.s3test.pivotal.io/small17/ config=/home/gpadmin/s3.conf') FORMAT 'csv'; +\d s3example + External table "public.s3example" + Column | Type | Modifiers +--------+------------------+----------- + date | text | + time | text | + open | double precision | + high | double precision | + low | double precision | + volume | integer | +Type: readable +Encoding: UTF8 +Format type: csv +Format options: delimiter ',' null '' escape '"' quote '"' +External location: "s3://s3-eu-west-1.amazonaws.com/euwest1.s3test.pivotal.io/small17/ config=/home/gpadmin/s3.conf" + +SELECT sum(open) FROM s3example; + sum +------------------ + 71676418.9189046 +(1 row) + +drop external table s3example; +create READABLE external table s3example (date text, time text, open float, high float, + low float, volume int) location('s3://s3-sa-east-1.amazonaws.com/saeast1.s3test.pivotal.io/small17/ config=/home/gpadmin/s3.conf') FORMAT 'csv'; +\d s3example + External table "public.s3example" + Column | Type | Modifiers +--------+------------------+----------- + date | text | + time | text | + open | double precision | + high | double precision | + low | double precision | + volume | integer | +Type: readable +Encoding: UTF8 +Format type: csv +Format options: delimiter ',' null '' escape '"' quote '"' +External location: "s3://s3-sa-east-1.amazonaws.com/saeast1.s3test.pivotal.io/small17/ config=/home/gpadmin/s3.conf" + +SELECT sum(open) FROM s3example; + sum +------------------ + 71676418.9189046 +(1 row) + +drop external table s3example; +create READABLE external table s3example (date text, time text, open float, high float, + low float, volume int) location('s3://s3-us-east-1.amazonaws.com/useast1.s3test.pivotal.io/small17/ config=/home/gpadmin/s3.conf') FORMAT 'csv'; +\d s3example + External table "public.s3example" + Column | Type | Modifiers +--------+------------------+----------- + date | text | + time | text | + open | double precision | + high | double precision | + low | double precision | + volume | integer | +Type: readable +Encoding: UTF8 +Format type: csv +Format options: delimiter ',' null '' escape '"' quote '"' +External location: "s3://s3-us-east-1.amazonaws.com/useast1.s3test.pivotal.io/small17/ config=/home/gpadmin/s3.conf" + +SELECT sum(open) FROM s3example; + sum +------------------ + 71676418.9189046 +(1 row) + +drop external table s3example; +create READABLE external table s3example (date text, time text, open float, high float, + low float, volume int) location('s3://s3-us-west-1.amazonaws.com/uswest1.s3test.pivotal.io/small17/ config=/home/gpadmin/s3.conf') FORMAT 'csv'; +\d s3example + External table "public.s3example" + Column | Type | Modifiers +--------+------------------+----------- + date | text | + time | text | + open | double precision | + high | double precision | + low | double precision | + volume | integer | +Type: readable +Encoding: UTF8 +Format type: csv +Format options: delimiter ',' null '' escape '"' quote '"' +External location: "s3://s3-us-west-1.amazonaws.com/uswest1.s3test.pivotal.io/small17/ config=/home/gpadmin/s3.conf" + +SELECT sum(open) FROM s3example; + sum +------------------ + 71676418.9189046 +(1 row) + +DROP EXTERNAL TABLE s3example; +DROP PROTOCOL s3; diff --git a/gpAux/extensions/gps3ext/regress/output/1_11_gzipped_data.source b/gpAux/extensions/gps3ext/regress/output/1_11_gzipped_data.source new file mode 100644 index 000000000000..e4d9fb3d19f3 --- /dev/null +++ b/gpAux/extensions/gps3ext/regress/output/1_11_gzipped_data.source @@ -0,0 +1,40 @@ +-- create the database functions +CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS + '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; +-- declare the protocol name along with in/out funcs +CREATE PROTOCOL s3 ( + readfunc = read_from_s3 +); +drop external table s3example; +ERROR: table "s3example" does not exist +create READABLE external table s3example (date text, time text, open float, high float, + low float, volume int) location('s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset1/gzipped_normal1/ config=/home/gpadmin/s3.conf') FORMAT 'csv'; +SELECT count(*) FROM s3example; + count +---------- + 31033039 +(1 row) + +SELECT sum(open) FROM s3example; + sum +------------------ + 1490754474.37203 +(1 row) + +SELECT avg(open) FROM s3example; + avg +------------------ + 48.0376567171532 +(1 row) + +drop external table s3example; +create READABLE external table s3example (Year text, Month text, DayofMonth text, DayOfWeek text, DepTime text, CRSDepTime text, ArrTime text,CRSArrTime text, UniqueCarrier text, FlightNum text,TailNum text, ActualElapsedTime text, CRSElapsedTime text, AirTime text, ArrDelay text, DepDelay text, Origin text, Dest text, Distance text, TaxiIn text, TaxiOut text, Cancelled text, CancellationCode text, Diverted text, CarrierDelay text, WeatherDelay text, NASDelay text, SecurityDelay text, LateAircraftDelay text) location('s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset2/gzipped_normal2/ config=/home/gpadmin/s3.conf') format 'csv' SEGMENT REJECT LIMIT 100 PERCENT; +SELECT count(*) FROM s3example; +NOTICE: Found 335925 data formatting errors (335925 or more input rows). Rejected related input data. + count +---------- + 52981760 +(1 row) + +DROP EXTERNAL TABLE s3example; +DROP PROTOCOL s3; diff --git a/gpAux/extensions/gps3ext/regress/output/1_12_no_prefix.source b/gpAux/extensions/gps3ext/regress/output/1_12_no_prefix.source new file mode 100644 index 000000000000..5d959d316534 --- /dev/null +++ b/gpAux/extensions/gps3ext/regress/output/1_12_no_prefix.source @@ -0,0 +1,85 @@ +-- create the database functions +CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS + '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; +-- declare the protocol name along with in/out funcs +CREATE PROTOCOL s3 ( + readfunc = read_from_s3 +); +drop external table s3example; +ERROR: table "s3example" does not exist +create READABLE external table s3example (date text, time text, open float, high float, + low float, volume int) location('s3://s3-ap-northeast-1.amazonaws.com/apnortheast1.s3test.pivotal.io config=/home/gpadmin/s3.conf') FORMAT 'csv'; +\d s3example + External table "public.s3example" + Column | Type | Modifiers +--------+------------------+----------- + date | text | + time | text | + open | double precision | + high | double precision | + low | double precision | + volume | integer | +Type: readable +Encoding: UTF8 +Format type: csv +Format options: delimiter ',' null '' escape '"' quote '"' +External location: "s3://s3-ap-northeast-1.amazonaws.com/apnortheast1.s3test.pivotal.io config=/home/gpadmin/s3.conf" + +SELECT sum(open) FROM s3example; + sum +------------------ + 71676418.9189046 +(1 row) + +drop external table s3example; +create READABLE external table s3example (date text, time text, open float, high float, + low float, volume int) location('s3://s3-eu-central-1.amazonaws.com/eucentral1.s3test.pivotal.io/ config=/home/gpadmin/s3.conf') FORMAT 'csv'; +\d s3example + External table "public.s3example" + Column | Type | Modifiers +--------+------------------+----------- + date | text | + time | text | + open | double precision | + high | double precision | + low | double precision | + volume | integer | +Type: readable +Encoding: UTF8 +Format type: csv +Format options: delimiter ',' null '' escape '"' quote '"' +External location: "s3://s3-eu-central-1.amazonaws.com/eucentral1.s3test.pivotal.io/ config=/home/gpadmin/s3.conf" + +SELECT sum(open) FROM s3example; + sum +------------------ + 71676418.9189046 +(1 row) + +drop external table s3example; +create READABLE external table s3example (date text, time text, open float, high float, + low float, volume int) location('s3://s3-sa-east-1.amazonaws.com/saeast1.s3test.pivotal.io/ config=/home/gpadmin/s3.conf') FORMAT 'csv'; +\d s3example + External table "public.s3example" + Column | Type | Modifiers +--------+------------------+----------- + date | text | + time | text | + open | double precision | + high | double precision | + low | double precision | + volume | integer | +Type: readable +Encoding: UTF8 +Format type: csv +Format options: delimiter ',' null '' escape '"' quote '"' +External location: "s3://s3-sa-east-1.amazonaws.com/saeast1.s3test.pivotal.io/ config=/home/gpadmin/s3.conf" + +SELECT sum(open) FROM s3example; + sum +------------------ + 71676418.9189046 +(1 row) + +DROP EXTERNAL TABLE s3example; +DROP PROTOCOL s3; diff --git a/gpAux/extensions/gps3ext/regress/output/2_01_invalid_syntax.source b/gpAux/extensions/gps3ext/regress/output/2_01_invalid_syntax.source new file mode 100644 index 000000000000..ebe09b1c4ac4 --- /dev/null +++ b/gpAux/extensions/gps3ext/regress/output/2_01_invalid_syntax.source @@ -0,0 +1,19 @@ +-- create the database functions +CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS + '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; +-- declare the protocol name along with in/out funcs +CREATE PROTOCOL s3 ( + readfunc = read_from_s3 +); +drop external table s3example; +ERROR: table "s3example" does not exist +create READABLE external table s3example (date float, time float, open float, high float, + low float, volume int) location('s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset1/normal/ config=/home/gpadmin/s3.conf') format 'csv'; +SELECT count(*) FROM s3example; +ERROR: invalid input syntax for type double precision: "09/28/2009" (seg0 slice1 ip-172-31-2-196.us-west-2.compute.internal:40000 pid=6425) +DETAIL: External table s3example, line 1 of s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset1/normal/ config=/home/gpadmin/s3.conf, column date +DROP EXTERNAL TABLE s3example; +DROP PROTOCOL s3; +WARNING: Releasing segworker groups since one or more segment connections failed. This will abort the transactions in the segments that did not get prepared. +NOTICE: Retry of the distributed transaction 'Abort Prepared' broadcast succeeded to the segments for gid = 1467688031-0000000206. +ERROR: The distributed transaction 'Prepare' broadcast failed to one or more segments for gid = 1467688031-0000000206. (cdbtm.c:689) diff --git a/gpAux/extensions/gps3ext/regress/output/2_02_invalid_region.source b/gpAux/extensions/gps3ext/regress/output/2_02_invalid_region.source new file mode 100644 index 000000000000..52153fc31982 --- /dev/null +++ b/gpAux/extensions/gps3ext/regress/output/2_02_invalid_region.source @@ -0,0 +1,17 @@ +-- create the database functions +CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS + '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; +-- declare the protocol name along with in/out funcs +CREATE PROTOCOL s3 ( + readfunc = read_from_s3 +); +ERROR: protocol "s3" already exists +drop external table s3example; +ERROR: table "s3example" does not exist +create READABLE external table s3example (date text, time text, open float, high float, + low float, volume int) location('s3://neverland.amazonaws.com/wherever/smalldata/ config=/home/gpadmin/s3.conf') format 'csv'; +SELECT count(*) FROM s3example; +ERROR: Failed to init S3 extension, segid = 1, segnum = 6, please check your configurations and net connection: Failed to list bucket with retries: s3://neverland.amazonaws.com/wherever/smalldata/, Function: listBucketWithRetry, File: src/s3bucket_reader.cpp(139). (gps3ext.cpp:88) (seg1 slice1 ip-172-31-2-196.us-west-2.compute.internal:40001 pid=6518) (cdbdisp.c:1326) +DETAIL: External table s3example, file s3://neverland.amazonaws.com/wherever/smalldata/ config=/home/gpadmin/s3.conf +DROP EXTERNAL TABLE s3example; +DROP PROTOCOL s3; diff --git a/gpAux/extensions/gps3ext/regress/output/2_03_invalid_config.source b/gpAux/extensions/gps3ext/regress/output/2_03_invalid_config.source new file mode 100644 index 000000000000..1c3c3c898465 --- /dev/null +++ b/gpAux/extensions/gps3ext/regress/output/2_03_invalid_config.source @@ -0,0 +1,16 @@ +-- create the database functions +CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS + '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; +-- declare the protocol name along with in/out funcs +CREATE PROTOCOL s3 ( + readfunc = read_from_s3 +); +drop external table s3example; +ERROR: table "s3example" does not exist +create READABLE external table s3example (date text, time text, open float, high float, + low float, volume int) location('s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset1/normal/') format 'csv'; +SELECT count(*) FROM s3example; +ERROR: Failed to init S3 extension, segid = -1, segnum = -1, please check your configurations and net connection: (gps3ext.cpp:88) (seg0 slice1 ip-172-31-2-196.us-west-2.compute.internal:40000 pid=6560) (cdbdisp.c:1326) +DETAIL: External table s3example, file s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset1/normal/ +DROP EXTERNAL TABLE s3example; +DROP PROTOCOL s3; diff --git a/gpAux/extensions/gps3ext/regress/output/2_04_invalid_header.source b/gpAux/extensions/gps3ext/regress/output/2_04_invalid_header.source new file mode 100644 index 000000000000..847afc36baf2 --- /dev/null +++ b/gpAux/extensions/gps3ext/regress/output/2_04_invalid_header.source @@ -0,0 +1,16 @@ +-- create the database functions +CREATE OR REPLACE FUNCTION read_from_s3() RETURNS integer AS + '$libdir/gps3ext.so', 's3_import' LANGUAGE C STABLE; +-- declare the protocol name along with in/out funcs +CREATE PROTOCOL s3 ( + readfunc = read_from_s3 +); +drop external table s3example; +ERROR: table "s3example" does not exist +create READABLE external table s3example (date text, time text, open float, high float, + low float, volume int) location('s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset2/csv_with_header/ config=/home/gpadmin/s3.conf') format 'csv'; +SELECT count(*) FROM s3example; +ERROR: invalid input syntax for type double precision: "open" (seg0 slice1 ip-172-31-2-196.us-west-2.compute.internal:40000 pid=6607) +DETAIL: External table s3example, line 1 of s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset2/csv_with_header/ config=/home/gpadmin/s3.conf, column open +DROP EXTERNAL TABLE s3example; +DROP PROTOCOL s3; diff --git a/gpAux/extensions/gps3ext/regress/regress.sh b/gpAux/extensions/gps3ext/regress/regress.sh deleted file mode 100755 index b594fd26234e..000000000000 --- a/gpAux/extensions/gps3ext/regress/regress.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -#> ~/regress.log && for i in `ls regress/regress_*.sql`; do echo XXXXXXXX START TESTING $i XXXXXXXX|tee -a ~/regress.log;psql -f $i 2>&1 |tee -a ~/regress.log; done - -GPCHECKCLOUD=./bin/gpcheckcloud/gpcheckcloud - -[ `$GPCHECKCLOUD -d "http://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset1/small17/data0014 config=/home/gpadmin/s3.conf" 2>/dev/null |md5sum |cut -d ' ' -f 1` = "68c4a63b721e7af0ae945ce109ca87ad" ] && echo OK. || echo Failed. - -[ `$GPCHECKCLOUD -d "http://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset1/small17/data0016 config=/home/gpadmin/s3.conf" 2>/dev/null |md5sum |cut -d ' ' -f 1` = "0fd502a303eb8f138f5916ec357721b1" ] && echo OK. || echo Failed. - -[ `$GPCHECKCLOUD -d "https://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset1/small17/data0014 config=/home/gpadmin/s3.conf" 2>/dev/null |md5sum |cut -d ' ' -f 1` = "68c4a63b721e7af0ae945ce109ca87ad" ] && echo OK. || echo Failed. - -[ `$GPCHECKCLOUD -d "https://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset1/small17/data0016 config=/home/gpadmin/s3.conf" 2>/dev/null |md5sum |cut -d ' ' -f 1` = "0fd502a303eb8f138f5916ec357721b1" ] && echo OK. || echo Failed. - -[ `$GPCHECKCLOUD -d "https://s3-us-west-2.amazonaws.com/s3test.pivotal.io/gzipped/data0001.gz config=/home/gpadmin/s3.conf" 2>/dev/null |md5sum |cut -d ' ' -f 1` = "b958fb80b98605a6095e6ebc4b9b4786" ] && echo OK. || echo Failed. - -[ `$GPCHECKCLOUD -d "s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/threebytes/ config=/home/gpadmin/s3.conf" 2>/dev/null |md5sum |cut -d ' ' -f 1` = "fe7d81814e02eb1296757e75bb3c6be9" ] && echo OK. || echo Failed. - -[ `$GPCHECKCLOUD -d "s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset1/small17/ config=/home/gpadmin/s3.conf" 2>/dev/null |md5sum |cut -d ' ' -f 1` = "138fc555074671912125ba692c678246" ] && echo OK. || echo Failed. - -[ `$GPCHECKCLOUD -d "s3://s3-us-east-1.amazonaws.com/useast1.s3test.pivotal.io/small17/ config=/home/gpadmin/s3.conf" 2>/dev/null |md5sum |cut -d ' ' -f 1` = "138fc555074671912125ba692c678246" ] && echo OK. || echo Failed. - -[ `$GPCHECKCLOUD -d "s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/gzipped/ config=/home/gpadmin/s3.conf" 2>/dev/null |md5sum |cut -d ' ' -f 1` = "7b2260e9a3a3f26e84aa28dc2124f68f" ] && echo OK. || echo Failed. - -[ `$GPCHECKCLOUD -d "s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset1/gzipped_normal1/ config=/home/gpadmin/s3.conf" 2>/dev/null |md5sum |cut -d ' ' -f 1` = "eacb7b210d3f7703ee06d16f520b103e" ] && echo OK. || echo Failed. - -# HUGE -[ `$GPCHECKCLOUD -d "https://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset2/hugefile/airlinedata1.csv config=/home/gpadmin/s3.conf" 2>/dev/null |md5sum |cut -d ' ' -f 1` = "f5811ad92c994f1d6913d5338575fe38" ] && echo OK. || echo Failed. - -# HUGE -[ `$GPCHECKCLOUD -d "s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset2/hugefile/ config=/home/gpadmin/s3.conf" 2>/dev/null |md5sum |cut -d ' ' -f 1` = "75baaa39f2b1544ed8af437c2cad86b7" ] && echo OK. || echo Failed. - -# HUGE -[ `$GPCHECKCLOUD -d "s3://s3-us-west-2.amazonaws.com/s3test.pivotal.io/dataset2/gzipped_normal2/ config=/home/gpadmin/s3.conf" 2>/dev/null |md5sum |cut -d ' ' -f 1` = "a930794bc885bccf6eed45bd40367a7d" ] && echo OK. || echo Failed. diff --git a/gpAux/extensions/gps3ext/regress/s3_regress_schedule b/gpAux/extensions/gps3ext/regress/s3_regress_schedule new file mode 100644 index 000000000000..8063e4198801 --- /dev/null +++ b/gpAux/extensions/gps3ext/regress/s3_regress_schedule @@ -0,0 +1,16 @@ +test: 1_01_normal +test: 1_02_log_error +test: 1_03_bad_data +test: 1_04_empty_prefix +test: 1_05_one_line +test: 1_06_1correct_1wrong +test: 1_07_huge_bad_data +test: 1_08_huge_correct_data +test: 1_09_partition +test: 1_10_all_regions +test: 1_11_gzipped_data +test: 1_12_no_prefix +test: 2_01_invalid_syntax +test: 2_02_invalid_region +test: 2_03_invalid_config +test: 2_04_invalid_header