{"action":"created","comment":{"url":"https://api.github.com/repos/prestodb/presto/pulls/comments/60639065","id":60639065,"diff_hunk":"@@ -326,7 +326,12 @@ public FSDataOutputStream create(Path path, FsPermission permission, boolean ove\n             throw new IOException(\"File already exists:\" + path);\n         }\n \n-        createDirectories(stagingDirectory.toPath());\n+        if (!stagingDirectory.exists()) {\n+            createDirectories(stagingDirectory.toPath());\n+        }\n+        if (!stagingDirectory.isDirectory()) {\n+            throw new IOException(\"Staging directory is not a directory: \" + stagingDirectory);","path":"presto-hive/src/main/java/com/facebook/presto/hive/PrestoS3FileSystem.java","position":9,"original_position":9,"commit_id":"f89bb8f8982d79cb88ff14f85e5fb929b88c04a4","original_commit_id":"f89bb8f8982d79cb88ff14f85e5fb929b88c04a4","user":{"login":"electrum","id":9230,"avatar_url":"https://avatars.githubusercontent.com/u/9230?v=3","gravatar_id":"","url":"https://api.github.com/users/electrum","html_url":"https://github.com/electrum","followers_url":"https://api.github.com/users/electrum/followers","following_url":"https://api.github.com/users/electrum/following{/other_user}","gists_url":"https://api.github.com/users/electrum/gists{/gist_id}","starred_url":"https://api.github.com/users/electrum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electrum/subscriptions","organizations_url":"https://api.github.com/users/electrum/orgs","repos_url":"https://api.github.com/users/electrum/repos","events_url":"https://api.github.com/users/electrum/events{/privacy}","received_events_url":"https://api.github.com/users/electrum/received_events","type":"User","site_admin":false},"body":"Or say \"Configured staging path is not a directory\"\n","created_at":"2016-04-21T19:13:29Z","updated_at":"2016-04-21T19:13:29Z","html_url":"https://github.com/prestodb/presto/pull/5018#discussion_r60639065","pull_request_url":"https://api.github.com/repos/prestodb/presto/pulls/5018","_links":{"self":{"href":"https://api.github.com/repos/prestodb/presto/pulls/comments/60639065"},"html":{"href":"https://github.com/prestodb/presto/pull/5018#discussion_r60639065"},"pull_request":{"href":"https://api.github.com/repos/prestodb/presto/pulls/5018"}}},"pull_request":{"url":"https://api.github.com/repos/prestodb/presto/pulls/5018","id":66383044,"html_url":"https://github.com/prestodb/presto/pull/5018","diff_url":"https://github.com/prestodb/presto/pull/5018.diff","patch_url":"https://github.com/prestodb/presto/pull/5018.patch","issue_url":"https://api.github.com/repos/prestodb/presto/issues/5018","number":5018,"state":"open","locked":false,"title":"Only create staging dir if it doesn't already exist","user":{"login":"ejono","id":3981507,"avatar_url":"https://avatars.githubusercontent.com/u/3981507?v=3","gravatar_id":"","url":"https://api.github.com/users/ejono","html_url":"https://github.com/ejono","followers_url":"https://api.github.com/users/ejono/followers","following_url":"https://api.github.com/users/ejono/following{/other_user}","gists_url":"https://api.github.com/users/ejono/gists{/gist_id}","starred_url":"https://api.github.com/users/ejono/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ejono/subscriptions","organizations_url":"https://api.github.com/users/ejono/orgs","repos_url":"https://api.github.com/users/ejono/repos","events_url":"https://api.github.com/users/ejono/events{/privacy}","received_events_url":"https://api.github.com/users/ejono/received_events","type":"User","site_admin":false},"body":"This fixes a FileAlreadyExistsException that can occur if the staging directory\r\nis a symlink to a directory rather than an actual directory.\r\n\r\nSee https://bugs.openjdk.java.net/browse/JDK-8130464 for more information about\r\nthis exception, which was deemed \"not an issue\".\r\n\r\nThis fixes https://github.com/prestodb/presto/issues/5017","created_at":"2016-04-13T20:07:17Z","updated_at":"2016-04-21T19:13:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"842dca9437e89f15b3d01e5496523224b9cfb99b","assignee":{"login":"haozhun","id":2020503,"avatar_url":"https://avatars.githubusercontent.com/u/2020503?v=3","gravatar_id":"","url":"https://api.github.com/users/haozhun","html_url":"https://github.com/haozhun","followers_url":"https://api.github.com/users/haozhun/followers","following_url":"https://api.github.com/users/haozhun/following{/other_user}","gists_url":"https://api.github.com/users/haozhun/gists{/gist_id}","starred_url":"https://api.github.com/users/haozhun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haozhun/subscriptions","organizations_url":"https://api.github.com/users/haozhun/orgs","repos_url":"https://api.github.com/users/haozhun/repos","events_url":"https://api.github.com/users/haozhun/events{/privacy}","received_events_url":"https://api.github.com/users/haozhun/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/prestodb/presto/pulls/5018/commits","review_comments_url":"https://api.github.com/repos/prestodb/presto/pulls/5018/comments","review_comment_url":"https://api.github.com/repos/prestodb/presto/pulls/comments{/number}","comments_url":"https://api.github.com/repos/prestodb/presto/issues/5018/comments","statuses_url":"https://api.github.com/repos/prestodb/presto/statuses/f89bb8f8982d79cb88ff14f85e5fb929b88c04a4","head":{"label":"ejono:s3-staging-dir-symlink","ref":"s3-staging-dir-symlink","sha":"f89bb8f8982d79cb88ff14f85e5fb929b88c04a4","user":{"login":"ejono","id":3981507,"avatar_url":"https://avatars.githubusercontent.com/u/3981507?v=3","gravatar_id":"","url":"https://api.github.com/users/ejono","html_url":"https://github.com/ejono","followers_url":"https://api.github.com/users/ejono/followers","following_url":"https://api.github.com/users/ejono/following{/other_user}","gists_url":"https://api.github.com/users/ejono/gists{/gist_id}","starred_url":"https://api.github.com/users/ejono/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ejono/subscriptions","organizations_url":"https://api.github.com/users/ejono/orgs","repos_url":"https://api.github.com/users/ejono/repos","events_url":"https://api.github.com/users/ejono/events{/privacy}","received_events_url":"https://api.github.com/users/ejono/received_events","type":"User","site_admin":false},"repo":{"id":54156104,"name":"presto","full_name":"ejono/presto","owner":{"login":"ejono","id":3981507,"avatar_url":"https://avatars.githubusercontent.com/u/3981507?v=3","gravatar_id":"","url":"https://api.github.com/users/ejono","html_url":"https://github.com/ejono","followers_url":"https://api.github.com/users/ejono/followers","following_url":"https://api.github.com/users/ejono/following{/other_user}","gists_url":"https://api.github.com/users/ejono/gists{/gist_id}","starred_url":"https://api.github.com/users/ejono/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ejono/subscriptions","organizations_url":"https://api.github.com/users/ejono/orgs","repos_url":"https://api.github.com/users/ejono/repos","events_url":"https://api.github.com/users/ejono/events{/privacy}","received_events_url":"https://api.github.com/users/ejono/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ejono/presto","description":"Distributed SQL query engine for running interactive analytic queries against big data sources.","fork":true,"url":"https://api.github.com/repos/ejono/presto","forks_url":"https://api.github.com/repos/ejono/presto/forks","keys_url":"https://api.github.com/repos/ejono/presto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ejono/presto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ejono/presto/teams","hooks_url":"https://api.github.com/repos/ejono/presto/hooks","issue_events_url":"https://api.github.com/repos/ejono/presto/issues/events{/number}","events_url":"https://api.github.com/repos/ejono/presto/events","assignees_url":"https://api.github.com/repos/ejono/presto/assignees{/user}","branches_url":"https://api.github.com/repos/ejono/presto/branches{/branch}","tags_url":"https://api.github.com/repos/ejono/presto/tags","blobs_url":"https://api.github.com/repos/ejono/presto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ejono/presto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ejono/presto/git/refs{/sha}","trees_url":"https://api.github.com/repos/ejono/presto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ejono/presto/statuses/{sha}","languages_url":"https://api.github.com/repos/ejono/presto/languages","stargazers_url":"https://api.github.com/repos/ejono/presto/stargazers","contributors_url":"https://api.github.com/repos/ejono/presto/contributors","subscribers_url":"https://api.github.com/repos/ejono/presto/subscribers","subscription_url":"https://api.github.com/repos/ejono/presto/subscription","commits_url":"https://api.github.com/repos/ejono/presto/commits{/sha}","git_commits_url":"https://api.github.com/repos/ejono/presto/git/commits{/sha}","comments_url":"https://api.github.com/repos/ejono/presto/comments{/number}","issue_comment_url":"https://api.github.com/repos/ejono/presto/issues/comments{/number}","contents_url":"https://api.github.com/repos/ejono/presto/contents/{+path}","compare_url":"https://api.github.com/repos/ejono/presto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ejono/presto/merges","archive_url":"https://api.github.com/repos/ejono/presto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ejono/presto/downloads","issues_url":"https://api.github.com/repos/ejono/presto/issues{/number}","pulls_url":"https://api.github.com/repos/ejono/presto/pulls{/number}","milestones_url":"https://api.github.com/repos/ejono/presto/milestones{/number}","notifications_url":"https://api.github.com/repos/ejono/presto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ejono/presto/labels{/name}","releases_url":"https://api.github.com/repos/ejono/presto/releases{/id}","deployments_url":"https://api.github.com/repos/ejono/presto/deployments","created_at":"2016-03-17T22:38:19Z","updated_at":"2016-03-17T22:38:30Z","pushed_at":"2016-04-14T01:57:56Z","git_url":"git://github.com/ejono/presto.git","ssh_url":"git@github.com:ejono/presto.git","clone_url":"https://github.com/ejono/presto.git","svn_url":"https://github.com/ejono/presto","homepage":"https://prestodb.io","size":63876,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"prestodb:master","ref":"master","sha":"850bca0006df80b4c5eb52c92589a3537e4f5e18","user":{"login":"prestodb","id":6882181,"avatar_url":"https://avatars.githubusercontent.com/u/6882181?v=3","gravatar_id":"","url":"https://api.github.com/users/prestodb","html_url":"https://github.com/prestodb","followers_url":"https://api.github.com/users/prestodb/followers","following_url":"https://api.github.com/users/prestodb/following{/other_user}","gists_url":"https://api.github.com/users/prestodb/gists{/gist_id}","starred_url":"https://api.github.com/users/prestodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prestodb/subscriptions","organizations_url":"https://api.github.com/users/prestodb/orgs","repos_url":"https://api.github.com/users/prestodb/repos","events_url":"https://api.github.com/users/prestodb/events{/privacy}","received_events_url":"https://api.github.com/users/prestodb/received_events","type":"Organization","site_admin":false},"repo":{"id":5349565,"name":"presto","full_name":"prestodb/presto","owner":{"login":"prestodb","id":6882181,"avatar_url":"https://avatars.githubusercontent.com/u/6882181?v=3","gravatar_id":"","url":"https://api.github.com/users/prestodb","html_url":"https://github.com/prestodb","followers_url":"https://api.github.com/users/prestodb/followers","following_url":"https://api.github.com/users/prestodb/following{/other_user}","gists_url":"https://api.github.com/users/prestodb/gists{/gist_id}","starred_url":"https://api.github.com/users/prestodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prestodb/subscriptions","organizations_url":"https://api.github.com/users/prestodb/orgs","repos_url":"https://api.github.com/users/prestodb/repos","events_url":"https://api.github.com/users/prestodb/events{/privacy}","received_events_url":"https://api.github.com/users/prestodb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/prestodb/presto","description":"Distributed SQL query engine for big data","fork":false,"url":"https://api.github.com/repos/prestodb/presto","forks_url":"https://api.github.com/repos/prestodb/presto/forks","keys_url":"https://api.github.com/repos/prestodb/presto/keys{/key_id}","collaborators_url":"https://api.github.com/repos/prestodb/presto/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/prestodb/presto/teams","hooks_url":"https://api.github.com/repos/prestodb/presto/hooks","issue_events_url":"https://api.github.com/repos/prestodb/presto/issues/events{/number}","events_url":"https://api.github.com/repos/prestodb/presto/events","assignees_url":"https://api.github.com/repos/prestodb/presto/assignees{/user}","branches_url":"https://api.github.com/repos/prestodb/presto/branches{/branch}","tags_url":"https://api.github.com/repos/prestodb/presto/tags","blobs_url":"https://api.github.com/repos/prestodb/presto/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/prestodb/presto/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/prestodb/presto/git/refs{/sha}","trees_url":"https://api.github.com/repos/prestodb/presto/git/trees{/sha}","statuses_url":"https://api.github.com/repos/prestodb/presto/statuses/{sha}","languages_url":"https://api.github.com/repos/prestodb/presto/languages","stargazers_url":"https://api.github.com/repos/prestodb/presto/stargazers","contributors_url":"https://api.github.com/repos/prestodb/presto/contributors","subscribers_url":"https://api.github.com/repos/prestodb/presto/subscribers","subscription_url":"https://api.github.com/repos/prestodb/presto/subscription","commits_url":"https://api.github.com/repos/prestodb/presto/commits{/sha}","git_commits_url":"https://api.github.com/repos/prestodb/presto/git/commits{/sha}","comments_url":"https://api.github.com/repos/prestodb/presto/comments{/number}","issue_comment_url":"https://api.github.com/repos/prestodb/presto/issues/comments{/number}","contents_url":"https://api.github.com/repos/prestodb/presto/contents/{+path}","compare_url":"https://api.github.com/repos/prestodb/presto/compare/{base}...{head}","merges_url":"https://api.github.com/repos/prestodb/presto/merges","archive_url":"https://api.github.com/repos/prestodb/presto/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/prestodb/presto/downloads","issues_url":"https://api.github.com/repos/prestodb/presto/issues{/number}","pulls_url":"https://api.github.com/repos/prestodb/presto/pulls{/number}","milestones_url":"https://api.github.com/repos/prestodb/presto/milestones{/number}","notifications_url":"https://api.github.com/repos/prestodb/presto/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/prestodb/presto/labels{/name}","releases_url":"https://api.github.com/repos/prestodb/presto/releases{/id}","deployments_url":"https://api.github.com/repos/prestodb/presto/deployments","created_at":"2012-08-09T01:03:37Z","updated_at":"2016-04-21T07:06:19Z","pushed_at":"2016-04-21T17:11:44Z","git_url":"git://github.com/prestodb/presto.git","ssh_url":"git@github.com:prestodb/presto.git","clone_url":"https://github.com/prestodb/presto.git","svn_url":"https://github.com/prestodb/presto","homepage":"https://prestodb.io","size":147453,"stargazers_count":4681,"watchers_count":4681,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1355,"mirror_url":null,"open_issues_count":585,"forks":1355,"open_issues":585,"watchers":4681,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/prestodb/presto/pulls/5018"},"html":{"href":"https://github.com/prestodb/presto/pull/5018"},"issue":{"href":"https://api.github.com/repos/prestodb/presto/issues/5018"},"comments":{"href":"https://api.github.com/repos/prestodb/presto/issues/5018/comments"},"review_comments":{"href":"https://api.github.com/repos/prestodb/presto/pulls/5018/comments"},"review_comment":{"href":"https://api.github.com/repos/prestodb/presto/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/prestodb/presto/pulls/5018/commits"},"statuses":{"href":"https://api.github.com/repos/prestodb/presto/statuses/f89bb8f8982d79cb88ff14f85e5fb929b88c04a4"}}}}