-
Notifications
You must be signed in to change notification settings - Fork 628
Code samples for "Power your Redshift Analytics With Apache Spark and… #57
base: master
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,29 @@ | |||
-- Create table weather | |||
CREATE EXTERNAL TABLE IF NOT EXISTS w ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggest to use a more descriptive name than 'w'
-- Create a database table with data for all flights in December 2013 | ||
create table all_flights | ||
( | ||
ORD_DELAY_ID bigint identity(0,1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ord_delay_id as primary key is confusing, can we consider renaming
""" | ||
from pandas.tseries.holiday import USFederalHolidayCalendar | ||
calendar = USFederalHolidayCalendar() | ||
holidays = calendar.holidays(start_date, end_date) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why only look for holidays in the present month, if the day passed in is the last day in month, nearest holiday could also be in the next month
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reconsider the logic in f_days_from_holiday, at present it only looks at present month
|
||
// Instance Profile for authentication to AWS resources | ||
val provider = new InstanceProfileCredentialsProvider() | ||
val credentials: AWSSessionCredentials = provider.getCredentials.asInstanceOf[AWSSessionCredentials] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can I use this in PySPARK?
thanks
… Amazon ML" blog