{"action":"opened","number":38,"pull_request":{"url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/pulls/38","id":31492826,"html_url":"https://github.com/kaizenplatform/fluent-plugin-bigquery/pull/38","diff_url":"https://github.com/kaizenplatform/fluent-plugin-bigquery/pull/38.diff","patch_url":"https://github.com/kaizenplatform/fluent-plugin-bigquery/pull/38.patch","issue_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/issues/38","number":38,"state":"open","locked":false,"title":"Handling insert errors","user":{"login":"hokuts","id":1435847,"avatar_url":"https://avatars.githubusercontent.com/u/1435847?v=3","gravatar_id":"","url":"https://api.github.com/users/hokuts","html_url":"https://github.com/hokuts","followers_url":"https://api.github.com/users/hokuts/followers","following_url":"https://api.github.com/users/hokuts/following{/other_user}","gists_url":"https://api.github.com/users/hokuts/gists{/gist_id}","starred_url":"https://api.github.com/users/hokuts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hokuts/subscriptions","organizations_url":"https://api.github.com/users/hokuts/orgs","repos_url":"https://api.github.com/users/hokuts/repos","events_url":"https://api.github.com/users/hokuts/events{/privacy}","received_events_url":"https://api.github.com/users/hokuts/received_events","type":"User","site_admin":false},"body":"When sending invalid value to BigQuery, it returns \"insertErrors\" field in response body with status 200.\r\nCurrent plugin seems not to be able to detect this error.\r\n\r\nsee: https://cloud.google.com/bigquery/docs/reference/v2/tabledata/insertAll\r\n\r\nThis patch will raise error when all records are in \"insertErrors\" field, and the records may be output secondary after retrying.\r\nThough undocumented, BigQuery seems treat all records as \"insert error\" even if only one of records in a request is invalid.\r\nex. sending 3 records with BigQuery API `insertAll` :\r\n```\r\n[\r\n  {time: \"2015-03-18 00:00:00 UTC\"},\r\n  {time: \"2015-03-18 01:00:00 INVALID_TIME_ZONE\"},\r\n  {time: \"2015-03-18 02:00:00 UTC\"}\r\n]\r\n```\r\nand it returns:\r\n```\r\n{\r\n \"kind\": \"bigquery#tableDataInsertAllResponse\",\r\n \"insertErrors\": [\r\n  {\r\n   \"index\": 1,\r\n   \"errors\": [\r\n    {\r\n     \"reason\": \"invalid\",\r\n     \"message\": \"Unrecognized timezone: INVALID_TIME_ZONE\"\r\n    }\r\n   ]\r\n  },\r\n  {\r\n   \"index\": 0,\r\n   \"errors\": [\r\n    {\r\n     \"reason\": \"stopped\"\r\n    }\r\n   ]\r\n  },\r\n  {\r\n   \"index\": 2,\r\n   \"errors\": [\r\n    {\r\n     \"reason\": \"stopped\"\r\n    }\r\n   ]\r\n  }\r\n ]\r\n}\r\n```","created_at":"2015-03-19T03:30:28Z","updated_at":"2015-03-19T03:30:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/pulls/38/commits","review_comments_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/pulls/38/comments","review_comment_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/issues/38/comments","statuses_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/statuses/56fb83ed356f1e55856be1f6b4b53c1ae740b5f9","head":{"label":"hokuts:handling_insert_errors","ref":"handling_insert_errors","sha":"56fb83ed356f1e55856be1f6b4b53c1ae740b5f9","user":{"login":"hokuts","id":1435847,"avatar_url":"https://avatars.githubusercontent.com/u/1435847?v=3","gravatar_id":"","url":"https://api.github.com/users/hokuts","html_url":"https://github.com/hokuts","followers_url":"https://api.github.com/users/hokuts/followers","following_url":"https://api.github.com/users/hokuts/following{/other_user}","gists_url":"https://api.github.com/users/hokuts/gists{/gist_id}","starred_url":"https://api.github.com/users/hokuts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hokuts/subscriptions","organizations_url":"https://api.github.com/users/hokuts/orgs","repos_url":"https://api.github.com/users/hokuts/repos","events_url":"https://api.github.com/users/hokuts/events{/privacy}","received_events_url":"https://api.github.com/users/hokuts/received_events","type":"User","site_admin":false},"repo":{"id":32377158,"name":"fluent-plugin-bigquery","full_name":"hokuts/fluent-plugin-bigquery","owner":{"login":"hokuts","id":1435847,"avatar_url":"https://avatars.githubusercontent.com/u/1435847?v=3","gravatar_id":"","url":"https://api.github.com/users/hokuts","html_url":"https://github.com/hokuts","followers_url":"https://api.github.com/users/hokuts/followers","following_url":"https://api.github.com/users/hokuts/following{/other_user}","gists_url":"https://api.github.com/users/hokuts/gists{/gist_id}","starred_url":"https://api.github.com/users/hokuts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hokuts/subscriptions","organizations_url":"https://api.github.com/users/hokuts/orgs","repos_url":"https://api.github.com/users/hokuts/repos","events_url":"https://api.github.com/users/hokuts/events{/privacy}","received_events_url":"https://api.github.com/users/hokuts/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hokuts/fluent-plugin-bigquery","description":"","fork":true,"url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery","forks_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/forks","keys_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/teams","hooks_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/hooks","issue_events_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/issues/events{/number}","events_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/events","assignees_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/assignees{/user}","branches_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/branches{/branch}","tags_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/tags","blobs_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/git/refs{/sha}","trees_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/statuses/{sha}","languages_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/languages","stargazers_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/stargazers","contributors_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/contributors","subscribers_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/subscribers","subscription_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/subscription","commits_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/commits{/sha}","git_commits_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/git/commits{/sha}","comments_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/comments{/number}","issue_comment_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/issues/comments{/number}","contents_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/contents/{+path}","compare_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/merges","archive_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/downloads","issues_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/issues{/number}","pulls_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/pulls{/number}","milestones_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/milestones{/number}","notifications_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/labels{/name}","releases_url":"https://api.github.com/repos/hokuts/fluent-plugin-bigquery/releases{/id}","created_at":"2015-03-17T07:07:10Z","updated_at":"2015-03-17T07:07:10Z","pushed_at":"2015-03-19T03:27:33Z","git_url":"git://github.com/hokuts/fluent-plugin-bigquery.git","ssh_url":"git@github.com:hokuts/fluent-plugin-bigquery.git","clone_url":"https://github.com/hokuts/fluent-plugin-bigquery.git","svn_url":"https://github.com/hokuts/fluent-plugin-bigquery","homepage":null,"size":684,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"kaizenplatform:master","ref":"master","sha":"d5ea9a78558c85d781ac604a696c14f56a0a06ba","user":{"login":"kaizenplatform","id":4617461,"avatar_url":"https://avatars.githubusercontent.com/u/4617461?v=3","gravatar_id":"","url":"https://api.github.com/users/kaizenplatform","html_url":"https://github.com/kaizenplatform","followers_url":"https://api.github.com/users/kaizenplatform/followers","following_url":"https://api.github.com/users/kaizenplatform/following{/other_user}","gists_url":"https://api.github.com/users/kaizenplatform/gists{/gist_id}","starred_url":"https://api.github.com/users/kaizenplatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaizenplatform/subscriptions","organizations_url":"https://api.github.com/users/kaizenplatform/orgs","repos_url":"https://api.github.com/users/kaizenplatform/repos","events_url":"https://api.github.com/users/kaizenplatform/events{/privacy}","received_events_url":"https://api.github.com/users/kaizenplatform/received_events","type":"Organization","site_admin":false},"repo":{"id":15252411,"name":"fluent-plugin-bigquery","full_name":"kaizenplatform/fluent-plugin-bigquery","owner":{"login":"kaizenplatform","id":4617461,"avatar_url":"https://avatars.githubusercontent.com/u/4617461?v=3","gravatar_id":"","url":"https://api.github.com/users/kaizenplatform","html_url":"https://github.com/kaizenplatform","followers_url":"https://api.github.com/users/kaizenplatform/followers","following_url":"https://api.github.com/users/kaizenplatform/following{/other_user}","gists_url":"https://api.github.com/users/kaizenplatform/gists{/gist_id}","starred_url":"https://api.github.com/users/kaizenplatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaizenplatform/subscriptions","organizations_url":"https://api.github.com/users/kaizenplatform/orgs","repos_url":"https://api.github.com/users/kaizenplatform/repos","events_url":"https://api.github.com/users/kaizenplatform/events{/privacy}","received_events_url":"https://api.github.com/users/kaizenplatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kaizenplatform/fluent-plugin-bigquery","description":"","fork":false,"url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery","forks_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/forks","keys_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/teams","hooks_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/hooks","issue_events_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/issues/events{/number}","events_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/events","assignees_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/assignees{/user}","branches_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/branches{/branch}","tags_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/tags","blobs_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/git/refs{/sha}","trees_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/statuses/{sha}","languages_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/languages","stargazers_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/stargazers","contributors_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/contributors","subscribers_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/subscribers","subscription_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/subscription","commits_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/commits{/sha}","git_commits_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/git/commits{/sha}","comments_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/comments{/number}","issue_comment_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/issues/comments{/number}","contents_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/contents/{+path}","compare_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/merges","archive_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/downloads","issues_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/issues{/number}","pulls_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/pulls{/number}","milestones_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/milestones{/number}","notifications_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/labels{/name}","releases_url":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/releases{/id}","created_at":"2013-12-17T11:11:19Z","updated_at":"2015-03-15T01:35:28Z","pushed_at":"2015-01-18T13:43:13Z","git_url":"git://github.com/kaizenplatform/fluent-plugin-bigquery.git","ssh_url":"git@github.com:kaizenplatform/fluent-plugin-bigquery.git","clone_url":"https://github.com/kaizenplatform/fluent-plugin-bigquery.git","svn_url":"https://github.com/kaizenplatform/fluent-plugin-bigquery","homepage":null,"size":684,"stargazers_count":80,"watchers_count":80,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":5,"forks":25,"open_issues":5,"watchers":80,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/pulls/38"},"html":{"href":"https://github.com/kaizenplatform/fluent-plugin-bigquery/pull/38"},"issue":{"href":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/issues/38"},"comments":{"href":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/issues/38/comments"},"review_comments":{"href":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/pulls/38/comments"},"review_comment":{"href":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/pulls/38/commits"},"statuses":{"href":"https://api.github.com/repos/kaizenplatform/fluent-plugin-bigquery/statuses/56fb83ed356f1e55856be1f6b4b53c1ae740b5f9"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":3,"additions":70,"deletions":3,"changed_files":2}}