MadKudu Docs

Home

Amazon Redshift

If your data is hosted in Amazon Redshift, you can export it directly to our S3 bucket, using the UNLOAD command in Redshift.

Note: This currently only works for Redshift clusters in the us-east-1 region.

The requirements for the file content as the same as for our flat file import, so make sure you review those first.

Track

You can create a .csv for Track using a command like this one:

UNLOAD ("SELECT event_text, event_timestamp, contact_key, event_attribute_1, event_attribute_2 FROM [your_table]")
TO 's3://madkudu-data-in-[your_org_id]/track/track.csv'
CREDENTIALS 'aws_access_key_id=[your_access_key];aws_secret_access_key=[your_secret_key]'
DELIMITER '~'
ADDQUOTES
ESCAPE
MANIFEST
GZIP
ALLOWOVERWRITE
PARALLEL ON
;

Where you modify the SELECT part to fit your own data structure.

IMPORTANT: Make sure you leave the parameters (everything after DELIMITER) unchanged.

NOTE: with this settings, every time you execute this command, the existing files will be overwritten.

Descriptor file

For us to be able to load this file, we’ll need to know what columns you’ve unloaded. To do so, in the same s3 folder (/track), upload another .csv called track_columns.csv:

  • it should list all the columns you included in the SELECT statement, in the exact same order
  • for example, if your UNLOAD was ('SELECT event_text, event_timestamp, contact_key, attribute_1, attribute_2 FROM some_table'), the .csv should contain exactly: event_text, event_timestamp, contact_key, attribute_1, attribute_2

You only need to modify this file when you change the content of your SELECTstatement (add, rename or remove columns)

Identify

UNLOAD ("SELECT contact_key, email, attribute_1, attribute_2 FROM [your_table]")
TO 's3://madkudu-data-in-[your_org_id]/identify/identify.csv'
CREDENTIALS 'aws_access_key_id=[your_access_key];aws_secret_access_key=[your_secret_key]'
DELIMITER '~'
ADDQUOTES
ESCAPE
MANIFEST
GZIP
ALLOWOVERWRITE
PARALLEL ON
;

Descriptor file

In that same folder, upload a file identify_columns.csv, describing your file, on the same model as track_columns.csv above

Group

UNLOAD ("SELECT contact_key, account_key, account_attribute_1, account_attribute_1 FROM [your_table]")
TO 's3://madkudu-data-in-[your_org_id]/group/group.csv'
CREDENTIALS 'aws_access_key_id=[your_access_key];aws_secret_access_key=[your_secret_key]'
DELIMITER '~'
ADDQUOTES
ESCAPE
MANIFEST
GZIP
ALLOWOVERWRITE
PARALLEL ON
;

Descriptor file

In that same folder, upload a file group_columns.csv, describing your file, on the same model as track_columns.csv above