{"action":"created","comment":{"url":"https://api.github.com/repos/awslabs/aws-big-data-blog/pulls/comments/80875054","pull_request_review_id":1892844,"id":80875054,"diff_hunk":"@@ -0,0 +1,87 @@\n+package com.amazonaws.bigdatablog.edba.emr;\n+\n+import java.util.ArrayList;\n+import java.util.Arrays;\n+import java.util.List;\n+import java.util.Random;\n+\n+import org.apache.spark.SparkConf;\n+import org.apache.spark.api.java.JavaRDD;\n+import org.apache.spark.api.java.JavaSparkContext;\n+import org.apache.spark.api.java.function.Function;\n+import org.apache.spark.sql.DataFrame;\n+import org.apache.spark.sql.Row;\n+import org.apache.spark.sql.RowFactory;\n+import org.apache.spark.sql.SQLContext;\n+import org.apache.spark.sql.SaveMode;\n+import org.apache.spark.sql.types.DataTypes;\n+import org.apache.spark.sql.types.StructField;\n+import org.apache.spark.sql.types.StructType;\n+\n+import com.amazonaws.auth.AWSSessionCredentials;\n+import com.amazonaws.auth.InstanceProfileCredentialsProvider;\n+import com.google.common.collect.ImmutableMap;\n+\n+import scala.collection.Seq;\n+\n+public class ProcessVendorTrasactions {\n+\n+\tfinal static String redshiftJDBCURL=\"jdbc:redshift://<<YourClusterEndPoint>>:5439/test?user=<<YourUser>>&password=<<YourPassword>>\";\n+\tpublic static void main(String[] args){\n+\t\t\n+\t\t    \tSparkConf conf = new SparkConf().setAppName(\"Spark Redshift No Access-Keys\");\n+\t\t    \tList<StructField> schemaFields = new ArrayList<StructField>();\n+\t\t    \tschemaFields.add(DataTypes.createStructField(\"vendor_id\", DataTypes.StringType, true));\n+\t\t    \tschemaFields.add(DataTypes.createStructField(\"trans_amount\", DataTypes.StringType, true));\n+\t\t    \tschemaFields.add(DataTypes.createStructField(\"trans_type\", DataTypes.StringType, true));\n+\t\t    \tschemaFields.add(DataTypes.createStructField(\"item_id\", DataTypes.StringType, true));\n+\t\t    \tschemaFields.add(DataTypes.createStructField(\"trans_date\", DataTypes.StringType, true));\n+\t\t    \tStructType schema = DataTypes.createStructType(schemaFields);","path":"aws-blog-event-driven-batch-analytics/src/main/java/com/amazonaws/bigdatablog/edba/emr/ProcessVendorTrasactions.java","position":39,"original_position":39,"commit_id":"960393e30d5bd05d259543b3f1c2daf548999140","original_commit_id":"960393e30d5bd05d259543b3f1c2daf548999140","user":{"login":"IanMeyers","id":6339696,"avatar_url":"https://avatars.githubusercontent.com/u/6339696?v=3","gravatar_id":"","url":"https://api.github.com/users/IanMeyers","html_url":"https://github.com/IanMeyers","followers_url":"https://api.github.com/users/IanMeyers/followers","following_url":"https://api.github.com/users/IanMeyers/following{/other_user}","gists_url":"https://api.github.com/users/IanMeyers/gists{/gist_id}","starred_url":"https://api.github.com/users/IanMeyers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IanMeyers/subscriptions","organizations_url":"https://api.github.com/users/IanMeyers/orgs","repos_url":"https://api.github.com/users/IanMeyers/repos","events_url":"https://api.github.com/users/IanMeyers/events{/privacy}","received_events_url":"https://api.github.com/users/IanMeyers/received_events","type":"User","site_admin":false},"body":"I'd suggest that lots of these items can be setup on the constructor and cached for the lifetime of the object, no?","created_at":"2016-09-28T09:22:59Z","updated_at":"2016-09-28T09:24:33Z","html_url":"https://github.com/awslabs/aws-big-data-blog/pull/60#discussion_r80875054","pull_request_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/pulls/60","_links":{"self":{"href":"https://api.github.com/repos/awslabs/aws-big-data-blog/pulls/comments/80875054"},"html":{"href":"https://github.com/awslabs/aws-big-data-blog/pull/60#discussion_r80875054"},"pull_request":{"href":"https://api.github.com/repos/awslabs/aws-big-data-blog/pulls/60"}}},"pull_request":{"url":"https://api.github.com/repos/awslabs/aws-big-data-blog/pulls/60","id":87001406,"html_url":"https://github.com/awslabs/aws-big-data-blog/pull/60","diff_url":"https://github.com/awslabs/aws-big-data-blog/pull/60.diff","patch_url":"https://github.com/awslabs/aws-big-data-blog/pull/60.patch","issue_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/issues/60","number":60,"state":"open","locked":false,"title":"aws-blog-event-driven-batch-analytics","user":{"login":"KarthikSonti","id":7276748,"avatar_url":"https://avatars.githubusercontent.com/u/7276748?v=3","gravatar_id":"","url":"https://api.github.com/users/KarthikSonti","html_url":"https://github.com/KarthikSonti","followers_url":"https://api.github.com/users/KarthikSonti/followers","following_url":"https://api.github.com/users/KarthikSonti/following{/other_user}","gists_url":"https://api.github.com/users/KarthikSonti/gists{/gist_id}","starred_url":"https://api.github.com/users/KarthikSonti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KarthikSonti/subscriptions","organizations_url":"https://api.github.com/users/KarthikSonti/orgs","repos_url":"https://api.github.com/users/KarthikSonti/repos","events_url":"https://api.github.com/users/KarthikSonti/events{/privacy}","received_events_url":"https://api.github.com/users/KarthikSonti/received_events","type":"User","site_admin":false},"body":"Hi \r\n\r\nI made the code commits related to the blog post \"Building Event Driven Batch Analytics on AWS\". Thanks\r\n","created_at":"2016-09-27T20:04:19Z","updated_at":"2016-09-28T09:24:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1aacba04c6e4ffdaf48899667f77e9eaeccfc2a3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/pulls/60/commits","review_comments_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/pulls/60/comments","review_comment_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/pulls/comments{/number}","comments_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/issues/60/comments","statuses_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/statuses/960393e30d5bd05d259543b3f1c2daf548999140","head":{"label":"KarthikSonti:master","ref":"master","sha":"960393e30d5bd05d259543b3f1c2daf548999140","user":{"login":"KarthikSonti","id":7276748,"avatar_url":"https://avatars.githubusercontent.com/u/7276748?v=3","gravatar_id":"","url":"https://api.github.com/users/KarthikSonti","html_url":"https://github.com/KarthikSonti","followers_url":"https://api.github.com/users/KarthikSonti/followers","following_url":"https://api.github.com/users/KarthikSonti/following{/other_user}","gists_url":"https://api.github.com/users/KarthikSonti/gists{/gist_id}","starred_url":"https://api.github.com/users/KarthikSonti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KarthikSonti/subscriptions","organizations_url":"https://api.github.com/users/KarthikSonti/orgs","repos_url":"https://api.github.com/users/KarthikSonti/repos","events_url":"https://api.github.com/users/KarthikSonti/events{/privacy}","received_events_url":"https://api.github.com/users/KarthikSonti/received_events","type":"User","site_admin":false},"repo":{"id":60649604,"name":"aws-big-data-blog","full_name":"KarthikSonti/aws-big-data-blog","owner":{"login":"KarthikSonti","id":7276748,"avatar_url":"https://avatars.githubusercontent.com/u/7276748?v=3","gravatar_id":"","url":"https://api.github.com/users/KarthikSonti","html_url":"https://github.com/KarthikSonti","followers_url":"https://api.github.com/users/KarthikSonti/followers","following_url":"https://api.github.com/users/KarthikSonti/following{/other_user}","gists_url":"https://api.github.com/users/KarthikSonti/gists{/gist_id}","starred_url":"https://api.github.com/users/KarthikSonti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KarthikSonti/subscriptions","organizations_url":"https://api.github.com/users/KarthikSonti/orgs","repos_url":"https://api.github.com/users/KarthikSonti/repos","events_url":"https://api.github.com/users/KarthikSonti/events{/privacy}","received_events_url":"https://api.github.com/users/KarthikSonti/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/KarthikSonti/aws-big-data-blog","description":"","fork":true,"url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog","forks_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/forks","keys_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/teams","hooks_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/hooks","issue_events_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/issues/events{/number}","events_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/events","assignees_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/assignees{/user}","branches_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/branches{/branch}","tags_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/tags","blobs_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/git/refs{/sha}","trees_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/statuses/{sha}","languages_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/languages","stargazers_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/stargazers","contributors_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/contributors","subscribers_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/subscribers","subscription_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/subscription","commits_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/commits{/sha}","git_commits_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/git/commits{/sha}","comments_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/comments{/number}","issue_comment_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/issues/comments{/number}","contents_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/contents/{+path}","compare_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/merges","archive_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/downloads","issues_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/issues{/number}","pulls_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/pulls{/number}","milestones_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/milestones{/number}","notifications_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/labels{/name}","releases_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/releases{/id}","deployments_url":"https://api.github.com/repos/KarthikSonti/aws-big-data-blog/deployments","created_at":"2016-06-07T22:04:22Z","updated_at":"2016-06-07T22:04:25Z","pushed_at":"2016-09-27T00:08:46Z","git_url":"git://github.com/KarthikSonti/aws-big-data-blog.git","ssh_url":"git@github.com:KarthikSonti/aws-big-data-blog.git","clone_url":"https://github.com/KarthikSonti/aws-big-data-blog.git","svn_url":"https://github.com/KarthikSonti/aws-big-data-blog","homepage":null,"size":31194,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"awslabs:master","ref":"master","sha":"15ec0b20a97e6ddf28a228daac47ab07590b7310","user":{"login":"awslabs","id":3299148,"avatar_url":"https://avatars.githubusercontent.com/u/3299148?v=3","gravatar_id":"","url":"https://api.github.com/users/awslabs","html_url":"https://github.com/awslabs","followers_url":"https://api.github.com/users/awslabs/followers","following_url":"https://api.github.com/users/awslabs/following{/other_user}","gists_url":"https://api.github.com/users/awslabs/gists{/gist_id}","starred_url":"https://api.github.com/users/awslabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awslabs/subscriptions","organizations_url":"https://api.github.com/users/awslabs/orgs","repos_url":"https://api.github.com/users/awslabs/repos","events_url":"https://api.github.com/users/awslabs/events{/privacy}","received_events_url":"https://api.github.com/users/awslabs/received_events","type":"Organization","site_admin":false},"repo":{"id":20819185,"name":"aws-big-data-blog","full_name":"awslabs/aws-big-data-blog","owner":{"login":"awslabs","id":3299148,"avatar_url":"https://avatars.githubusercontent.com/u/3299148?v=3","gravatar_id":"","url":"https://api.github.com/users/awslabs","html_url":"https://github.com/awslabs","followers_url":"https://api.github.com/users/awslabs/followers","following_url":"https://api.github.com/users/awslabs/following{/other_user}","gists_url":"https://api.github.com/users/awslabs/gists{/gist_id}","starred_url":"https://api.github.com/users/awslabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awslabs/subscriptions","organizations_url":"https://api.github.com/users/awslabs/orgs","repos_url":"https://api.github.com/users/awslabs/repos","events_url":"https://api.github.com/users/awslabs/events{/privacy}","received_events_url":"https://api.github.com/users/awslabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/awslabs/aws-big-data-blog","description":"","fork":false,"url":"https://api.github.com/repos/awslabs/aws-big-data-blog","forks_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/forks","keys_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/teams","hooks_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/hooks","issue_events_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/issues/events{/number}","events_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/events","assignees_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/assignees{/user}","branches_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/branches{/branch}","tags_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/tags","blobs_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/git/refs{/sha}","trees_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/statuses/{sha}","languages_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/languages","stargazers_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/stargazers","contributors_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/contributors","subscribers_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/subscribers","subscription_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/subscription","commits_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/commits{/sha}","git_commits_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/git/commits{/sha}","comments_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/comments{/number}","issue_comment_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/issues/comments{/number}","contents_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/contents/{+path}","compare_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/merges","archive_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/downloads","issues_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/issues{/number}","pulls_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/pulls{/number}","milestones_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/milestones{/number}","notifications_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/labels{/name}","releases_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/releases{/id}","deployments_url":"https://api.github.com/repos/awslabs/aws-big-data-blog/deployments","created_at":"2014-06-13T22:06:35Z","updated_at":"2016-09-27T15:39:55Z","pushed_at":"2016-09-27T21:24:19Z","git_url":"git://github.com/awslabs/aws-big-data-blog.git","ssh_url":"git@github.com:awslabs/aws-big-data-blog.git","clone_url":"https://github.com/awslabs/aws-big-data-blog.git","svn_url":"https://github.com/awslabs/aws-big-data-blog","homepage":null,"size":31378,"stargazers_count":231,"watchers_count":231,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":153,"mirror_url":null,"open_issues_count":8,"forks":153,"open_issues":8,"watchers":231,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/awslabs/aws-big-data-blog/pulls/60"},"html":{"href":"https://github.com/awslabs/aws-big-data-blog/pull/60"},"issue":{"href":"https://api.github.com/repos/awslabs/aws-big-data-blog/issues/60"},"comments":{"href":"https://api.github.com/repos/awslabs/aws-big-data-blog/issues/60/comments"},"review_comments":{"href":"https://api.github.com/repos/awslabs/aws-big-data-blog/pulls/60/comments"},"review_comment":{"href":"https://api.github.com/repos/awslabs/aws-big-data-blog/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/awslabs/aws-big-data-blog/pulls/60/commits"},"statuses":{"href":"https://api.github.com/repos/awslabs/aws-big-data-blog/statuses/960393e30d5bd05d259543b3f1c2daf548999140"}}}}
{"actor":{"display_login":"IanMeyers"}}