How to execute scheduled SQL scripts in on Amazon Redshift

0 votes

I have a series of queries to be executed every hour automatically in Redshift Most of them are aggregation on my tables.

I have tried using AWS Lambda with CloudWatch Events, but Lambda functions only survive for 5 minutes max and my queries can take up to 25 minutes

Nov 19, 2018 in AWS by datageek
• 3,090 points
4,077 views

1 answer to this question.

0 votes

I had faced the same problem earlier. You can use R or Python for that.

You need to install package RpostgreSQL and connect to your Redshift:

drv <- dbDriver("PostgreSQL")
conn <-dbConnect(drv,host='mm-stats-1.ctea4hmr4vlw.us-east-1.redshift.amazonaws.com',port='5439',dbname='stats',user='xxx',password='yyy')

and then you can build report with markdown and then scheduled it with crontab task. Also if it helps I have used the mailR package to send the report to other users

answered Nov 19, 2018 by Archana
• 5,640 points

Related Questions In AWS

0 votes
1 answer

How to connect Amazon RedShift in Apache Spark?

It turns out you just need a ...READ MORE

answered Aug 22, 2018 in AWS by Archana
• 4,170 points
7,612 views
0 votes
1 answer

How to restore a cluster from backup in Amazon Redshift

Amazon Redshift replicates all your data within ...READ MORE

answered Sep 28, 2018 in AWS by Archana
• 4,170 points
1,868 views
0 votes
1 answer

how to get aws account number /id based on EC2 instance which is hosted in amazon

You can obtain account number from an ...READ MORE

answered Feb 21, 2022 in AWS by Korak
• 5,820 points
2,253 views
0 votes
1 answer

How can I do Continuous data ingestion from on prem data sources to redshift

I can Recommend looking into AWS Schema ...READ MORE

answered Aug 8, 2018 in AWS by Priyaj
• 58,020 points
1,859 views
0 votes
1 answer

Error in Adding LIMIT fixes “Invalid digit, Value N” in Amazon Redshift.

This could be expressed simply as: SELECT TOP ...READ MORE

answered Sep 4, 2018 in AWS by Priyaj
• 58,020 points
10,896 views
0 votes
1 answer

Scaling in Amazon Redshift

The existing data warehouse cluster remains available ...READ MORE

answered Sep 27, 2018 in AWS by Archana
• 4,170 points
796 views
0 votes
1 answer

Single-Node Cluster & Multiple-Node Cluster

In the single-node cluster, you have a ...READ MORE

answered Sep 27, 2018 in AWS by Archana
• 4,170 points
1,451 views
+1 vote
2 answers

How to read a csv file stored in Amazon S3 using csv.DictReader

The code would be something like this: import ...READ MORE

answered Oct 25, 2018 in AWS by Archana
• 5,640 points
54,452 views
0 votes
1 answer

How to monitor & track a chatbot on Amazon Lex?

You can track metrics for your bot ...READ MORE

answered Nov 8, 2018 in AWS by Archana
• 5,640 points
1,395 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP