Skip to content

Conversation

@EeshanChatterjee
Copy link
Contributor

Added function to insert an R data.frame into a redshift table. Created the query automatically.

@DerekYves
Copy link

is this pull request going to be merged? Looks useful and wondered if anyone has tested it? I'm new with redshift and trying to build a process for writing small and big tables into redshift; guess two approaches will be needed.

Also having trouble with search path settings: writing tables always goes into the public schema, meaning the "." Is ignored in the database name, so "test.test" gets written to the public schema as test.test rather than as table "test" in the "test" schema. Any tips on this would be greatly appreciated!

@pingles
Copy link
Owner

pingles commented Jan 20, 2017

Hi, thanks for the reminder.

I think the biggest issue is that it kind of assumes you're inserting textual data and assumes you're writing all columns at once. It'd be much better/reliable to handle the specific columns being inserted and generate the string appropriately- currently including the escaping character would break the insert.

As for inserting data- our experience has been that using INSERT INTO is extraordinarily slow in comparison to the bulk loads. We wrote a tool to automate loading data from S3 (so you could just dump CSV files on S3 and it'd automatically ingest) but I think AWS have examples of doing the same with Lambdas now.

@EeshanChatterjee
Copy link
Contributor Author

Agree with Paul here. Bulk uploads are very inefficient using the above. I had written this with the primary objective of not having to have a separate piece of code / script to upload small lookup files to redshift- each no more than a few MBs (single digits!).

@DerekYves
Copy link

DerekYves commented Jan 20, 2017 via email

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.

3 participants