-
Notifications
You must be signed in to change notification settings - Fork 594
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: Noel Kwan <[email protected]>
- Loading branch information
1 parent
5b50b9a
commit 194ee27
Showing
3 changed files
with
341 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
control substitution on | ||
|
||
statement ok | ||
DROP SINK IF EXISTS pg_sink; | ||
|
||
statement ok | ||
DROP SINK IF EXISTS pg_sink_jdbc; | ||
|
||
statement ok | ||
DROP TABLE IF EXISTS datagen_source; | ||
|
||
system ok | ||
psql -c 'DROP TABLE IF EXISTS datagen_source;' | ||
|
||
system ok | ||
psql -c 'DROP TABLE IF EXISTS datagen_source_jdbc;' | ||
|
||
system ok | ||
psql -c 'CREATE TABLE datagen_source (id INT PRIMARY KEY, v1 varchar);' | ||
|
||
system ok | ||
psql -c 'CREATE TABLE datagen_source_jdbc (id INT PRIMARY KEY, v1 varchar);' | ||
|
||
statement ok | ||
CREATE TABLE datagen_source (id INT PRIMARY KEY, v1 varchar); | ||
|
||
statement ok | ||
INSERT INTO datagen_source SELECT key, 'asjdkk2kbdk2uk2ubek2' FROM generate_series(1, 2000000) t(key); | ||
|
||
statement ok | ||
flush; | ||
|
||
statement ok | ||
CREATE SINK pg_sink FROM datagen_source WITH ( | ||
connector='postgres', | ||
host='$PGHOST', | ||
port='$PGPORT', | ||
user='$PGUSER', | ||
password='$PGPASSWORD', | ||
database='$PGDATABASE', | ||
table='datagen_source', | ||
type='upsert', | ||
primary_key='id', | ||
); | ||
|
||
sleep 240s | ||
|
||
system ok | ||
psql --tuples-only -c 'select count(*) from datagen_source;' | ||
---- | ||
2000000 | ||
|
||
|
||
statement ok | ||
CREATE SINK pg_sink_jdbc FROM datagen_source WITH ( | ||
connector='jdbc', | ||
jdbc.url='jdbc:postgresql://${PGHOST}:${PGPORT}/${PGDATABASE}?user=${PGUSER}&password=${PGPASSWORD}', | ||
table.name='datagen_source_jdbc', | ||
primary_key='id', | ||
type='upsert' | ||
); | ||
|
||
sleep 240s | ||
|
||
system ok | ||
psql --tuples-only -c 'select count(*) from datagen_source_jdbc;' | ||
---- | ||
2000000 | ||
|
||
|
||
statement ok | ||
DROP SINK IF EXISTS pg_sink; | ||
|
||
statement ok | ||
DROP SINK IF EXISTS pg_sink_jdbc; | ||
|
||
statement ok | ||
DROP TABLE IF EXISTS datagen_source; | ||
|
||
system ok | ||
psql -c 'DROP TABLE IF EXISTS datagen_source;' | ||
|
||
system ok | ||
psql -c 'DROP TABLE IF EXISTS datagen_source_jdbc;' |
Oops, something went wrong.