4

So I'm trying to load data into my Redshift database from an S3 bucket. I have a table 'Example' which has a field 'timestamp' in the format 'YY-MM-DD HH:MM:SS'.

Using the copy query to load the data, so I'm able to load for a specific pattern/prefix, but I want to load data after a certain timestamp, say, greater than '2014-07-09 10:00:00'. How do I approach this?

1 Answer 1

1

You have two options:

  1. either process the file before you load it to S3 (and upload only the data with timestamp greater than $SOME_TIMESTAMP)

  2. use the COPY command to load the file into intermediate table (can be even temp table - as long as you stay within the same session) and then run:

    insert into YOUR_ORIGINAL_TABLE (select * from YOUR_TEMP_TABLE where timestamp > WHATEVER_YOU_NEED)
    
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.