How To Convert MySQL Two Digit Year To Four Digit Year

How To Convert MySQL Two Digit Year To Four Digit Year

Today I was working with a small MySQL data set. The data provided by a CSV file and needed to load it into AWS RDS MySQL. Since the RDS does not support the Load data inline. So I have manually convert the CSV file to .sql file. But the problem statement is, in CSV the date time column had two digit year format and while converting into sql it considered the day part as year and automatically added 20  in the beginning. MySQL has makedate function , but it didn’t work for me. My entire data for the year 2018.

Read More

Automate AWS RedShift Snapshot And Restore

Automate AWS RedShift Snapshot And Restore

Redshift will help to handle a massive data warehouse workload. I used to manage some redshift cluster in past. Whenever the developers or I wanted to test something on RedShift, we generally take a snapshot and then launch a new cluster or launch it from the automated snapshot. This is fine for Ad-Hoc workloads. Think something like, if your developers want to continually test and run their sample queries on the cluster on daily basis with updated data then there will be a headache for AWS Admins, So I have prepared a shell script for this to mate this process and it’ll send the email alerts when any one of the steps are failed. This script will help you to automate AWS Redshift snapshot and restore. 

Read More