Amazon Redshift to Apache Spark Migration

SQLines tools can help you convert database schema (DDL), views, queries and SQL scripts from Amazon Redshift to Apache Spark.

Databases:

Migration Reference

SQL Language Elements

Interval expressions:

Redshift Spark
1 NOW() + INTERVAL '5 hours' NOW() + INTERVAL '5' HOUR
NOW() + INTERVAL '5.5 hours' NOW() + INTERVAL '5:30' HOUR TO MINUTE Since Spark 3

Built-in SQL Functions

Converting datetime functions:

Redshift Spark
1 DATE(value) Convert to DATE data type (year, month and day) DATE(value)
2 DATE_TRUNC(unit, datetime) Truncate the datetime value DATE_TRUNC(unit, datetime)
3 NOW() Get the start date and time of the transaction NOW()