{"action":"created","comment":{"url":"https://api.github.com/repos/spotify/spark-bigquery/pulls/comments/91153602","pull_request_review_id":11663174,"id":91153602,"diff_hunk":"@@ -109,8 +110,28 @@ private[bigquery] class BigQueryClient(conf: Configuration) {\n    */\n   def load(gcsPath: String, destinationTable: TableReference,\n            writeDisposition: WriteDisposition.Value = null,\n-           createDisposition: CreateDisposition.Value = null): Unit = {\n+           createDisposition: CreateDisposition.Value = null,\n+           isPartitionedByDay: Boolean = false): Unit = {\n+\n     val tableName = BigQueryStrings.toString(destinationTable)\n+    if(isPartitionedByDay) {\n+        val datasetId = destinationTable.getDatasetId\n+        val projectId: String = destinationTable.getProjectId\n+      try {\n+        logger.info(\"Creating Time Partitioned Table\")\n+        val table = new Table()\n+        table.setTableReference(destinationTable)\n+        val timePartitioning = new TimePartitioning()\n+        timePartitioning.setType(\"DAY\")\n+        timePartitioning.setExpirationMs(DEFAULT_TABLE_EXPIRATION_MS)","path":"src/main/scala/com/spotify/spark/bigquery/BigQueryClient.scala","position":26,"original_position":26,"commit_id":"70143785aac61a8bf5f811c6052b6f4b0ceb64b3","original_commit_id":"70143785aac61a8bf5f811c6052b6f4b0ceb64b3","user":{"login":"nevillelyh","id":468514,"avatar_url":"https://avatars.githubusercontent.com/u/468514?v=3","gravatar_id":"","url":"https://api.github.com/users/nevillelyh","html_url":"https://github.com/nevillelyh","followers_url":"https://api.github.com/users/nevillelyh/followers","following_url":"https://api.github.com/users/nevillelyh/following{/other_user}","gists_url":"https://api.github.com/users/nevillelyh/gists{/gist_id}","starred_url":"https://api.github.com/users/nevillelyh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nevillelyh/subscriptions","organizations_url":"https://api.github.com/users/nevillelyh/orgs","repos_url":"https://api.github.com/users/nevillelyh/repos","events_url":"https://api.github.com/users/nevillelyh/events{/privacy}","received_events_url":"https://api.github.com/users/nevillelyh/received_events","type":"User","site_admin":false},"body":"This is not user customizable?","created_at":"2016-12-06T19:30:10Z","updated_at":"2016-12-06T19:30:19Z","html_url":"https://github.com/spotify/spark-bigquery/pull/25#discussion_r91153602","pull_request_url":"https://api.github.com/repos/spotify/spark-bigquery/pulls/25","_links":{"self":{"href":"https://api.github.com/repos/spotify/spark-bigquery/pulls/comments/91153602"},"html":{"href":"https://github.com/spotify/spark-bigquery/pull/25#discussion_r91153602"},"pull_request":{"href":"https://api.github.com/repos/spotify/spark-bigquery/pulls/25"}}},"pull_request":{"url":"https://api.github.com/repos/spotify/spark-bigquery/pulls/25","id":95230255,"html_url":"https://github.com/spotify/spark-bigquery/pull/25","diff_url":"https://github.com/spotify/spark-bigquery/pull/25.diff","patch_url":"https://github.com/spotify/spark-bigquery/pull/25.patch","issue_url":"https://api.github.com/repos/spotify/spark-bigquery/issues/25","number":25,"state":"open","locked":false,"title":"Partition tables by day","user":{"login":"samelamin","id":4311963,"avatar_url":"https://avatars.githubusercontent.com/u/4311963?v=3","gravatar_id":"","url":"https://api.github.com/users/samelamin","html_url":"https://github.com/samelamin","followers_url":"https://api.github.com/users/samelamin/followers","following_url":"https://api.github.com/users/samelamin/following{/other_user}","gists_url":"https://api.github.com/users/samelamin/gists{/gist_id}","starred_url":"https://api.github.com/users/samelamin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samelamin/subscriptions","organizations_url":"https://api.github.com/users/samelamin/orgs","repos_url":"https://api.github.com/users/samelamin/repos","events_url":"https://api.github.com/users/samelamin/events{/privacy}","received_events_url":"https://api.github.com/users/samelamin/received_events","type":"User","site_admin":false},"body":"This PR was inspired by this [issue](https://github.com/spotify/spark-bigquery/issues/13)\r\n\r\nAt the moment there is no way of partitioning by day via the job configuration, see [here](http://stackoverflow.com/questions/40665794/table-partitioning-scheme-with-load-job-configuration/40793663#40793663). Google engineers are ofcourse working on it\r\n\r\nIn the meantime us mortals will have to settle for using the client\r\n\r\n\r\n","created_at":"2016-11-24T21:52:50Z","updated_at":"2016-12-06T19:30:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9ca3ace765e5311ae69984650977558da62db665","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/spotify/spark-bigquery/pulls/25/commits","review_comments_url":"https://api.github.com/repos/spotify/spark-bigquery/pulls/25/comments","review_comment_url":"https://api.github.com/repos/spotify/spark-bigquery/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spotify/spark-bigquery/issues/25/comments","statuses_url":"https://api.github.com/repos/spotify/spark-bigquery/statuses/70143785aac61a8bf5f811c6052b6f4b0ceb64b3","head":{"label":"samelamin:Partition_Tables_By_Day","ref":"Partition_Tables_By_Day","sha":"70143785aac61a8bf5f811c6052b6f4b0ceb64b3","user":{"login":"samelamin","id":4311963,"avatar_url":"https://avatars.githubusercontent.com/u/4311963?v=3","gravatar_id":"","url":"https://api.github.com/users/samelamin","html_url":"https://github.com/samelamin","followers_url":"https://api.github.com/users/samelamin/followers","following_url":"https://api.github.com/users/samelamin/following{/other_user}","gists_url":"https://api.github.com/users/samelamin/gists{/gist_id}","starred_url":"https://api.github.com/users/samelamin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samelamin/subscriptions","organizations_url":"https://api.github.com/users/samelamin/orgs","repos_url":"https://api.github.com/users/samelamin/repos","events_url":"https://api.github.com/users/samelamin/events{/privacy}","received_events_url":"https://api.github.com/users/samelamin/received_events","type":"User","site_admin":false},"repo":{"id":74508064,"name":"spark-bigquery","full_name":"samelamin/spark-bigquery","owner":{"login":"samelamin","id":4311963,"avatar_url":"https://avatars.githubusercontent.com/u/4311963?v=3","gravatar_id":"","url":"https://api.github.com/users/samelamin","html_url":"https://github.com/samelamin","followers_url":"https://api.github.com/users/samelamin/followers","following_url":"https://api.github.com/users/samelamin/following{/other_user}","gists_url":"https://api.github.com/users/samelamin/gists{/gist_id}","starred_url":"https://api.github.com/users/samelamin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samelamin/subscriptions","organizations_url":"https://api.github.com/users/samelamin/orgs","repos_url":"https://api.github.com/users/samelamin/repos","events_url":"https://api.github.com/users/samelamin/events{/privacy}","received_events_url":"https://api.github.com/users/samelamin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/samelamin/spark-bigquery","description":"Google BigQuery support for Spark, SQL, and DataFrames","fork":true,"url":"https://api.github.com/repos/samelamin/spark-bigquery","forks_url":"https://api.github.com/repos/samelamin/spark-bigquery/forks","keys_url":"https://api.github.com/repos/samelamin/spark-bigquery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/samelamin/spark-bigquery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/samelamin/spark-bigquery/teams","hooks_url":"https://api.github.com/repos/samelamin/spark-bigquery/hooks","issue_events_url":"https://api.github.com/repos/samelamin/spark-bigquery/issues/events{/number}","events_url":"https://api.github.com/repos/samelamin/spark-bigquery/events","assignees_url":"https://api.github.com/repos/samelamin/spark-bigquery/assignees{/user}","branches_url":"https://api.github.com/repos/samelamin/spark-bigquery/branches{/branch}","tags_url":"https://api.github.com/repos/samelamin/spark-bigquery/tags","blobs_url":"https://api.github.com/repos/samelamin/spark-bigquery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/samelamin/spark-bigquery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/samelamin/spark-bigquery/git/refs{/sha}","trees_url":"https://api.github.com/repos/samelamin/spark-bigquery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/samelamin/spark-bigquery/statuses/{sha}","languages_url":"https://api.github.com/repos/samelamin/spark-bigquery/languages","stargazers_url":"https://api.github.com/repos/samelamin/spark-bigquery/stargazers","contributors_url":"https://api.github.com/repos/samelamin/spark-bigquery/contributors","subscribers_url":"https://api.github.com/repos/samelamin/spark-bigquery/subscribers","subscription_url":"https://api.github.com/repos/samelamin/spark-bigquery/subscription","commits_url":"https://api.github.com/repos/samelamin/spark-bigquery/commits{/sha}","git_commits_url":"https://api.github.com/repos/samelamin/spark-bigquery/git/commits{/sha}","comments_url":"https://api.github.com/repos/samelamin/spark-bigquery/comments{/number}","issue_comment_url":"https://api.github.com/repos/samelamin/spark-bigquery/issues/comments{/number}","contents_url":"https://api.github.com/repos/samelamin/spark-bigquery/contents/{+path}","compare_url":"https://api.github.com/repos/samelamin/spark-bigquery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/samelamin/spark-bigquery/merges","archive_url":"https://api.github.com/repos/samelamin/spark-bigquery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/samelamin/spark-bigquery/downloads","issues_url":"https://api.github.com/repos/samelamin/spark-bigquery/issues{/number}","pulls_url":"https://api.github.com/repos/samelamin/spark-bigquery/pulls{/number}","milestones_url":"https://api.github.com/repos/samelamin/spark-bigquery/milestones{/number}","notifications_url":"https://api.github.com/repos/samelamin/spark-bigquery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/samelamin/spark-bigquery/labels{/name}","releases_url":"https://api.github.com/repos/samelamin/spark-bigquery/releases{/id}","deployments_url":"https://api.github.com/repos/samelamin/spark-bigquery/deployments","created_at":"2016-11-22T19:55:15Z","updated_at":"2016-11-22T19:55:16Z","pushed_at":"2016-12-03T00:35:27Z","git_url":"git://github.com/samelamin/spark-bigquery.git","ssh_url":"git@github.com:samelamin/spark-bigquery.git","clone_url":"https://github.com/samelamin/spark-bigquery.git","svn_url":"https://github.com/samelamin/spark-bigquery","homepage":null,"size":43,"stargazers_count":0,"watchers_count":0,"language":"Scala","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":"spotify:master","ref":"master","sha":"6bee2845b9576f08d2d4ba3ed1d162913b0a080f","user":{"login":"spotify","id":251374,"avatar_url":"https://avatars.githubusercontent.com/u/251374?v=3","gravatar_id":"","url":"https://api.github.com/users/spotify","html_url":"https://github.com/spotify","followers_url":"https://api.github.com/users/spotify/followers","following_url":"https://api.github.com/users/spotify/following{/other_user}","gists_url":"https://api.github.com/users/spotify/gists{/gist_id}","starred_url":"https://api.github.com/users/spotify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spotify/subscriptions","organizations_url":"https://api.github.com/users/spotify/orgs","repos_url":"https://api.github.com/users/spotify/repos","events_url":"https://api.github.com/users/spotify/events{/privacy}","received_events_url":"https://api.github.com/users/spotify/received_events","type":"Organization","site_admin":false},"repo":{"id":56882754,"name":"spark-bigquery","full_name":"spotify/spark-bigquery","owner":{"login":"spotify","id":251374,"avatar_url":"https://avatars.githubusercontent.com/u/251374?v=3","gravatar_id":"","url":"https://api.github.com/users/spotify","html_url":"https://github.com/spotify","followers_url":"https://api.github.com/users/spotify/followers","following_url":"https://api.github.com/users/spotify/following{/other_user}","gists_url":"https://api.github.com/users/spotify/gists{/gist_id}","starred_url":"https://api.github.com/users/spotify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spotify/subscriptions","organizations_url":"https://api.github.com/users/spotify/orgs","repos_url":"https://api.github.com/users/spotify/repos","events_url":"https://api.github.com/users/spotify/events{/privacy}","received_events_url":"https://api.github.com/users/spotify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spotify/spark-bigquery","description":"Google BigQuery support for Spark, SQL, and DataFrames","fork":false,"url":"https://api.github.com/repos/spotify/spark-bigquery","forks_url":"https://api.github.com/repos/spotify/spark-bigquery/forks","keys_url":"https://api.github.com/repos/spotify/spark-bigquery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spotify/spark-bigquery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spotify/spark-bigquery/teams","hooks_url":"https://api.github.com/repos/spotify/spark-bigquery/hooks","issue_events_url":"https://api.github.com/repos/spotify/spark-bigquery/issues/events{/number}","events_url":"https://api.github.com/repos/spotify/spark-bigquery/events","assignees_url":"https://api.github.com/repos/spotify/spark-bigquery/assignees{/user}","branches_url":"https://api.github.com/repos/spotify/spark-bigquery/branches{/branch}","tags_url":"https://api.github.com/repos/spotify/spark-bigquery/tags","blobs_url":"https://api.github.com/repos/spotify/spark-bigquery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spotify/spark-bigquery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spotify/spark-bigquery/git/refs{/sha}","trees_url":"https://api.github.com/repos/spotify/spark-bigquery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spotify/spark-bigquery/statuses/{sha}","languages_url":"https://api.github.com/repos/spotify/spark-bigquery/languages","stargazers_url":"https://api.github.com/repos/spotify/spark-bigquery/stargazers","contributors_url":"https://api.github.com/repos/spotify/spark-bigquery/contributors","subscribers_url":"https://api.github.com/repos/spotify/spark-bigquery/subscribers","subscription_url":"https://api.github.com/repos/spotify/spark-bigquery/subscription","commits_url":"https://api.github.com/repos/spotify/spark-bigquery/commits{/sha}","git_commits_url":"https://api.github.com/repos/spotify/spark-bigquery/git/commits{/sha}","comments_url":"https://api.github.com/repos/spotify/spark-bigquery/comments{/number}","issue_comment_url":"https://api.github.com/repos/spotify/spark-bigquery/issues/comments{/number}","contents_url":"https://api.github.com/repos/spotify/spark-bigquery/contents/{+path}","compare_url":"https://api.github.com/repos/spotify/spark-bigquery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spotify/spark-bigquery/merges","archive_url":"https://api.github.com/repos/spotify/spark-bigquery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spotify/spark-bigquery/downloads","issues_url":"https://api.github.com/repos/spotify/spark-bigquery/issues{/number}","pulls_url":"https://api.github.com/repos/spotify/spark-bigquery/pulls{/number}","milestones_url":"https://api.github.com/repos/spotify/spark-bigquery/milestones{/number}","notifications_url":"https://api.github.com/repos/spotify/spark-bigquery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spotify/spark-bigquery/labels{/name}","releases_url":"https://api.github.com/repos/spotify/spark-bigquery/releases{/id}","deployments_url":"https://api.github.com/repos/spotify/spark-bigquery/deployments","created_at":"2016-04-22T20:17:31Z","updated_at":"2016-12-04T11:15:40Z","pushed_at":"2016-12-06T19:18:05Z","git_url":"git://github.com/spotify/spark-bigquery.git","ssh_url":"git@github.com:spotify/spark-bigquery.git","clone_url":"https://github.com/spotify/spark-bigquery.git","svn_url":"https://github.com/spotify/spark-bigquery","homepage":null,"size":38,"stargazers_count":43,"watchers_count":43,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":14,"forks":12,"open_issues":14,"watchers":43,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spotify/spark-bigquery/pulls/25"},"html":{"href":"https://github.com/spotify/spark-bigquery/pull/25"},"issue":{"href":"https://api.github.com/repos/spotify/spark-bigquery/issues/25"},"comments":{"href":"https://api.github.com/repos/spotify/spark-bigquery/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/spotify/spark-bigquery/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/spotify/spark-bigquery/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spotify/spark-bigquery/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/spotify/spark-bigquery/statuses/70143785aac61a8bf5f811c6052b6f4b0ceb64b3"}}}}
{"actor":{"display_login":"nevillelyh"}}