Skip to content
This repository has been archived by the owner on Jul 20, 2022. It is now read-only.

Code samples for "Power your Redshift Analytics With Apache Spark and… #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ravgit
Copy link

@ravgit ravgit commented Aug 18, 2016

… Amazon ML" blog

@@ -0,0 +1,29 @@
-- Create table weather
CREATE EXTERNAL TABLE IF NOT EXISTS w (

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),

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)

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

Copy link

@sandhyae sandhyae left a 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]

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants