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
• 2,940 points
529 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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,360 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,090 points
1,020 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,090 points
137 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
• 56,140 points
117 views
0 votes
1 answer

How to upload a lib for Tomcat in Amazon EC2?

You need to set the proper privileges ...READ MORE

answered Aug 20, 2018 in AWS by Archana
• 4,090 points
30 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
• 56,140 points
1,080 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,090 points
17 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,090 points
22 views
–1 vote
1 answer

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,360 points
4,246 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,360 points
70 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.