Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for more properties to be passed with TableMapping #500

Merged
merged 3 commits into from
Oct 11, 2023

Conversation

iskakaushik
Copy link
Contributor

No description provided.

@iskakaushik iskakaushik merged commit 1fa5903 into main Oct 11, 2023
11 checks passed
@iskakaushik iskakaushik deleted the part-key-cdc branch October 11, 2023 01:05
@saisrirampur
Copy link
Contributor

saisrirampur commented Oct 12, 2023

You can now specify any (non CTID) column as a partition column. The column needs to be of the type integer and timestamp and need not be monotonically increasing. PeerDB under the covers takes of creating equal sized partitions for streaming to the target. Below is an example of how the MIRROR would be modified:

CREATE MIRROR postgres_to_snowflake
FROM postgres_peer TO snowflake_peer
WITH TABLE MAPPING (
                    -- if partition column is not specified in table name mapping, CTID will be used
                    public.pgbench_branches:public.pgbench_branches,
                    public.pgbench_tellers:public.pgbench_tellers,
                    {
                    from: public.pgbench_accounts,
                    to: public.pgbench_accounts,
                    key: aid -- partition column
                    })
WITH (
  do_initial_copy = true,
  snapshot_sync_mode='avro',
  snapshot_num_rows_per_partition = 500000,
  snapshot_max_parallel_workers = 4,
  snapshot_num_tables_in_parallel = 1,
  snapshot_staging_path = ''
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants