{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/99934599","pull_request_review_id":20625646,"id":99934599,"diff_hunk":"@@ -110,7 +110,11 @@ private[csv] class UnivocityParser(\n       }\n \n     case _: BooleanType => (d: String) =>\n-      nullSafeDatum(d, name, nullable, options)(_.toBoolean)\n+      nullSafeDatum(d, name, nullable, options) { datum =>\n+        if (datum.equalsIgnoreCase(options.trueValue)) true","path":"sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/csv/UnivocityParser.scala","position":6,"original_position":6,"commit_id":"0926626f3ab6411e405fb31c4a291d49092a19a4","original_commit_id":"0926626f3ab6411e405fb31c4a291d49092a19a4","user":{"login":"jaceklaskowski","id":62313,"avatar_url":"https://avatars.githubusercontent.com/u/62313?v=3","gravatar_id":"","url":"https://api.github.com/users/jaceklaskowski","html_url":"https://github.com/jaceklaskowski","followers_url":"https://api.github.com/users/jaceklaskowski/followers","following_url":"https://api.github.com/users/jaceklaskowski/following{/other_user}","gists_url":"https://api.github.com/users/jaceklaskowski/gists{/gist_id}","starred_url":"https://api.github.com/users/jaceklaskowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaceklaskowski/subscriptions","organizations_url":"https://api.github.com/users/jaceklaskowski/orgs","repos_url":"https://api.github.com/users/jaceklaskowski/repos","events_url":"https://api.github.com/users/jaceklaskowski/events{/privacy}","received_events_url":"https://api.github.com/users/jaceklaskowski/received_events","type":"User","site_admin":false},"body":"Is there any reason why you compare `datum` to `options.trueValue` and not vice versa as it's in `CSVInferSchema.scala` above?","created_at":"2017-02-07T21:32:40Z","updated_at":"2017-02-07T21:32:41Z","html_url":"https://github.com/apache/spark/pull/16812#discussion_r99934599","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/16812","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/99934599"},"html":{"href":"https://github.com/apache/spark/pull/16812#discussion_r99934599"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/16812"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/16812","id":104713725,"html_url":"https://github.com/apache/spark/pull/16812","diff_url":"https://github.com/apache/spark/pull/16812.diff","patch_url":"https://github.com/apache/spark/pull/16812.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/16812","number":16812,"state":"open","locked":false,"title":"[SPARK-19465][SQL] Added options for custom boolean values in CSV","user":{"login":"dhunziker","id":3452802,"avatar_url":"https://avatars.githubusercontent.com/u/3452802?v=3","gravatar_id":"","url":"https://api.github.com/users/dhunziker","html_url":"https://github.com/dhunziker","followers_url":"https://api.github.com/users/dhunziker/followers","following_url":"https://api.github.com/users/dhunziker/following{/other_user}","gists_url":"https://api.github.com/users/dhunziker/gists{/gist_id}","starred_url":"https://api.github.com/users/dhunziker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhunziker/subscriptions","organizations_url":"https://api.github.com/users/dhunziker/orgs","repos_url":"https://api.github.com/users/dhunziker/repos","events_url":"https://api.github.com/users/dhunziker/events{/privacy}","received_events_url":"https://api.github.com/users/dhunziker/received_events","type":"User","site_admin":false},"body":"## What changes were proposed in this pull request?\r\n\r\nIt adds trueValue and falseValue options for customising the values used for Boolean types in CSV files. The default behaviour remains unchanged but the two new options allow for more flexibility. As it is currently the case, the values are matched ignoring their case.  \r\n\r\n## How was this patch tested?\r\n\r\nExtended existing unit tests for custom Boolean values and added a new test for asserting the IllegalArgumentException thrown by Scala's StringLike.toBoolean function.\r\n","created_at":"2017-02-05T20:29:04Z","updated_at":"2017-02-07T21:32:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5dc5daff251f3b7a34ed489746182a650c7fc064","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/16812/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/16812/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/16812/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/0926626f3ab6411e405fb31c4a291d49092a19a4","head":{"label":"dhunziker:feature/SPARK-19465","ref":"feature/SPARK-19465","sha":"0926626f3ab6411e405fb31c4a291d49092a19a4","user":{"login":"dhunziker","id":3452802,"avatar_url":"https://avatars.githubusercontent.com/u/3452802?v=3","gravatar_id":"","url":"https://api.github.com/users/dhunziker","html_url":"https://github.com/dhunziker","followers_url":"https://api.github.com/users/dhunziker/followers","following_url":"https://api.github.com/users/dhunziker/following{/other_user}","gists_url":"https://api.github.com/users/dhunziker/gists{/gist_id}","starred_url":"https://api.github.com/users/dhunziker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhunziker/subscriptions","organizations_url":"https://api.github.com/users/dhunziker/orgs","repos_url":"https://api.github.com/users/dhunziker/repos","events_url":"https://api.github.com/users/dhunziker/events{/privacy}","received_events_url":"https://api.github.com/users/dhunziker/received_events","type":"User","site_admin":false},"repo":{"id":59416099,"name":"spark","full_name":"dhunziker/spark","owner":{"login":"dhunziker","id":3452802,"avatar_url":"https://avatars.githubusercontent.com/u/3452802?v=3","gravatar_id":"","url":"https://api.github.com/users/dhunziker","html_url":"https://github.com/dhunziker","followers_url":"https://api.github.com/users/dhunziker/followers","following_url":"https://api.github.com/users/dhunziker/following{/other_user}","gists_url":"https://api.github.com/users/dhunziker/gists{/gist_id}","starred_url":"https://api.github.com/users/dhunziker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhunziker/subscriptions","organizations_url":"https://api.github.com/users/dhunziker/orgs","repos_url":"https://api.github.com/users/dhunziker/repos","events_url":"https://api.github.com/users/dhunziker/events{/privacy}","received_events_url":"https://api.github.com/users/dhunziker/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dhunziker/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/dhunziker/spark","forks_url":"https://api.github.com/repos/dhunziker/spark/forks","keys_url":"https://api.github.com/repos/dhunziker/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dhunziker/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dhunziker/spark/teams","hooks_url":"https://api.github.com/repos/dhunziker/spark/hooks","issue_events_url":"https://api.github.com/repos/dhunziker/spark/issues/events{/number}","events_url":"https://api.github.com/repos/dhunziker/spark/events","assignees_url":"https://api.github.com/repos/dhunziker/spark/assignees{/user}","branches_url":"https://api.github.com/repos/dhunziker/spark/branches{/branch}","tags_url":"https://api.github.com/repos/dhunziker/spark/tags","blobs_url":"https://api.github.com/repos/dhunziker/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dhunziker/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dhunziker/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/dhunziker/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dhunziker/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/dhunziker/spark/languages","stargazers_url":"https://api.github.com/repos/dhunziker/spark/stargazers","contributors_url":"https://api.github.com/repos/dhunziker/spark/contributors","subscribers_url":"https://api.github.com/repos/dhunziker/spark/subscribers","subscription_url":"https://api.github.com/repos/dhunziker/spark/subscription","commits_url":"https://api.github.com/repos/dhunziker/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/dhunziker/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/dhunziker/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/dhunziker/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/dhunziker/spark/contents/{+path}","compare_url":"https://api.github.com/repos/dhunziker/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dhunziker/spark/merges","archive_url":"https://api.github.com/repos/dhunziker/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dhunziker/spark/downloads","issues_url":"https://api.github.com/repos/dhunziker/spark/issues{/number}","pulls_url":"https://api.github.com/repos/dhunziker/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/dhunziker/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/dhunziker/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dhunziker/spark/labels{/name}","releases_url":"https://api.github.com/repos/dhunziker/spark/releases{/id}","deployments_url":"https://api.github.com/repos/dhunziker/spark/deployments","created_at":"2016-05-22T14:17:40Z","updated_at":"2016-05-22T14:18:04Z","pushed_at":"2017-02-05T20:07:41Z","git_url":"git://github.com/dhunziker/spark.git","ssh_url":"git@github.com:dhunziker/spark.git","clone_url":"https://github.com/dhunziker/spark.git","svn_url":"https://github.com/dhunziker/spark","homepage":null,"size":255749,"stargazers_count":0,"watchers_count":0,"language":"Scala","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":"apache:master","ref":"master","sha":"b94f4b6fa65232b6113125198e031b5ad0faafd6","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":17165658,"name":"spark","full_name":"apache/spark","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/spark","description":"Mirror of Apache Spark","fork":false,"url":"https://api.github.com/repos/apache/spark","forks_url":"https://api.github.com/repos/apache/spark/forks","keys_url":"https://api.github.com/repos/apache/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/spark/teams","hooks_url":"https://api.github.com/repos/apache/spark/hooks","issue_events_url":"https://api.github.com/repos/apache/spark/issues/events{/number}","events_url":"https://api.github.com/repos/apache/spark/events","assignees_url":"https://api.github.com/repos/apache/spark/assignees{/user}","branches_url":"https://api.github.com/repos/apache/spark/branches{/branch}","tags_url":"https://api.github.com/repos/apache/spark/tags","blobs_url":"https://api.github.com/repos/apache/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/spark/languages","stargazers_url":"https://api.github.com/repos/apache/spark/stargazers","contributors_url":"https://api.github.com/repos/apache/spark/contributors","subscribers_url":"https://api.github.com/repos/apache/spark/subscribers","subscription_url":"https://api.github.com/repos/apache/spark/subscription","commits_url":"https://api.github.com/repos/apache/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/spark/contents/{+path}","compare_url":"https://api.github.com/repos/apache/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/spark/merges","archive_url":"https://api.github.com/repos/apache/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/spark/downloads","issues_url":"https://api.github.com/repos/apache/spark/issues{/number}","pulls_url":"https://api.github.com/repos/apache/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/spark/labels{/name}","releases_url":"https://api.github.com/repos/apache/spark/releases{/id}","deployments_url":"https://api.github.com/repos/apache/spark/deployments","created_at":"2014-02-25T08:00:08Z","updated_at":"2017-02-07T18:52:10Z","pushed_at":"2017-02-07T21:29:24Z","git_url":"git://github.com/apache/spark.git","ssh_url":"git@github.com:apache/spark.git","clone_url":"https://github.com/apache/spark.git","svn_url":"https://github.com/apache/spark","homepage":null,"size":263617,"stargazers_count":11605,"watchers_count":11605,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10866,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":479,"forks":10866,"open_issues":479,"watchers":11605,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/16812"},"html":{"href":"https://github.com/apache/spark/pull/16812"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/16812"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/16812/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/16812/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/16812/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/0926626f3ab6411e405fb31c4a291d49092a19a4"}}}}
{"actor":{"display_login":"jaceklaskowski"}}