{"action":"created","comment":{"url":"https://api.github.com/repos/apache/arrow/pulls/comments/243762645","pull_request_review_id":187619790,"id":243762645,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0Mzc2MjY0NQ==","diff_hunk":"@@ -70,21 +204,46 @@ impl Reader {\n     /// Create a new CsvReader\n     pub fn new(\n         file: File,\n-        schema: Arc<Schema>,\n+        schema: Option<Arc<Schema>>,","path":"rust/src/csv/reader.rs","position":null,"original_position":161,"commit_id":"8dbb0af88c460dde2651ffa6e879cb33f6c1dba1","original_commit_id":"a5f9c2d47db972e2b02edff6efece23fc8fb4ba0","user":{"login":"nevi-me","id":1876878,"node_id":"MDQ6VXNlcjE4NzY4Nzg=","avatar_url":"https://avatars3.githubusercontent.com/u/1876878?v=4","gravatar_id":"","url":"https://api.github.com/users/nevi-me","html_url":"https://github.com/nevi-me","followers_url":"https://api.github.com/users/nevi-me/followers","following_url":"https://api.github.com/users/nevi-me/following{/other_user}","gists_url":"https://api.github.com/users/nevi-me/gists{/gist_id}","starred_url":"https://api.github.com/users/nevi-me/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nevi-me/subscriptions","organizations_url":"https://api.github.com/users/nevi-me/orgs","repos_url":"https://api.github.com/users/nevi-me/repos","events_url":"https://api.github.com/users/nevi-me/events{/privacy}","received_events_url":"https://api.github.com/users/nevi-me/received_events","type":"User","site_admin":false},"body":"I implemented a `ReaderBuilder`. Please let me know if it's fine the way that I did it. I initially created builder methods that returned a `&mut ReaderBuilder` (e.g. pub fn with_delimiter(&self) -> &mut Self`, but using the methods in examples was PITA. So I used a builder that returns a new copy each time.","created_at":"2018-12-23T12:54:47Z","updated_at":"2018-12-23T12:54:47Z","html_url":"https://github.com/apache/arrow/pull/3128#discussion_r243762645","pull_request_url":"https://api.github.com/repos/apache/arrow/pulls/3128","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/apache/arrow/pulls/comments/243762645"},"html":{"href":"https://github.com/apache/arrow/pull/3128#discussion_r243762645"},"pull_request":{"href":"https://api.github.com/repos/apache/arrow/pulls/3128"}},"in_reply_to_id":243660176},"pull_request":{"url":"https://api.github.com/repos/apache/arrow/pulls/3128","id":237058998,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM3MDU4OTk4","html_url":"https://github.com/apache/arrow/pull/3128","diff_url":"https://github.com/apache/arrow/pull/3128.diff","patch_url":"https://github.com/apache/arrow/pull/3128.patch","issue_url":"https://api.github.com/repos/apache/arrow/issues/3128","number":3128,"state":"open","locked":false,"title":"ARROW-3839: [Rust] Add ability to infer schema in CSV reader","user":{"login":"nevi-me","id":1876878,"node_id":"MDQ6VXNlcjE4NzY4Nzg=","avatar_url":"https://avatars3.githubusercontent.com/u/1876878?v=4","gravatar_id":"","url":"https://api.github.com/users/nevi-me","html_url":"https://github.com/nevi-me","followers_url":"https://api.github.com/users/nevi-me/followers","following_url":"https://api.github.com/users/nevi-me/following{/other_user}","gists_url":"https://api.github.com/users/nevi-me/gists{/gist_id}","starred_url":"https://api.github.com/users/nevi-me/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nevi-me/subscriptions","organizations_url":"https://api.github.com/users/nevi-me/orgs","repos_url":"https://api.github.com/users/nevi-me/repos","events_url":"https://api.github.com/users/nevi-me/events{/privacy}","received_events_url":"https://api.github.com/users/nevi-me/received_events","type":"User","site_admin":false},"body":"This adds the ability to infer schema on reading a CSV file. I've changed the `Reader` interface to take `Option<Schema>`, for which we infer the schema if none is provided.\r\n\r\nI would have liked to also include timestamp inferrence, but looks like we don't yet have time support. I opened [ARROW-3959](https://issues.apache.org/jira/browse/ARROW-3959) to track this.\r\n\r\nThere are some outstanding design considerations that I'd appreciate some input on:\r\n\r\n1. How to best structure the function's arguments. We'll need to pass in options for timestamp parsing, not sure what else. I've added a field delimiter in the interim.\r\n2. What should happen if one tries to read a file with no headers? I haven't added a test case for that, and I think the response should be a failure\r\n3. ~When inferring the schema, should we read the whole file, or a portion of the file. A lot of tools tend to read `n` first records (e.g. MSSQL import tool), but Spark reads the whole file. I prefer the latter as it'd guarantee that the generated schema won't fail to read the file~ (addressed)\r\n\r\n\r\n","created_at":"2018-12-08T10:01:09Z","updated_at":"2018-12-23T12:54:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"390be7c786e7c54cd625301227ecd5d764ab8f29","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/arrow/pulls/3128/commits","review_comments_url":"https://api.github.com/repos/apache/arrow/pulls/3128/comments","review_comment_url":"https://api.github.com/repos/apache/arrow/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/arrow/issues/3128/comments","statuses_url":"https://api.github.com/repos/apache/arrow/statuses/8dbb0af88c460dde2651ffa6e879cb33f6c1dba1","head":{"label":"nevi-me:master","ref":"master","sha":"8dbb0af88c460dde2651ffa6e879cb33f6c1dba1","user":{"login":"nevi-me","id":1876878,"node_id":"MDQ6VXNlcjE4NzY4Nzg=","avatar_url":"https://avatars3.githubusercontent.com/u/1876878?v=4","gravatar_id":"","url":"https://api.github.com/users/nevi-me","html_url":"https://github.com/nevi-me","followers_url":"https://api.github.com/users/nevi-me/followers","following_url":"https://api.github.com/users/nevi-me/following{/other_user}","gists_url":"https://api.github.com/users/nevi-me/gists{/gist_id}","starred_url":"https://api.github.com/users/nevi-me/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nevi-me/subscriptions","organizations_url":"https://api.github.com/users/nevi-me/orgs","repos_url":"https://api.github.com/users/nevi-me/repos","events_url":"https://api.github.com/users/nevi-me/events{/privacy}","received_events_url":"https://api.github.com/users/nevi-me/received_events","type":"User","site_admin":false},"repo":{"id":143882590,"node_id":"MDEwOlJlcG9zaXRvcnkxNDM4ODI1OTA=","name":"arrow","full_name":"nevi-me/arrow","private":false,"owner":{"login":"nevi-me","id":1876878,"node_id":"MDQ6VXNlcjE4NzY4Nzg=","avatar_url":"https://avatars3.githubusercontent.com/u/1876878?v=4","gravatar_id":"","url":"https://api.github.com/users/nevi-me","html_url":"https://github.com/nevi-me","followers_url":"https://api.github.com/users/nevi-me/followers","following_url":"https://api.github.com/users/nevi-me/following{/other_user}","gists_url":"https://api.github.com/users/nevi-me/gists{/gist_id}","starred_url":"https://api.github.com/users/nevi-me/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nevi-me/subscriptions","organizations_url":"https://api.github.com/users/nevi-me/orgs","repos_url":"https://api.github.com/users/nevi-me/repos","events_url":"https://api.github.com/users/nevi-me/events{/privacy}","received_events_url":"https://api.github.com/users/nevi-me/received_events","type":"User","site_admin":false},"html_url":"https://github.com/nevi-me/arrow","description":"Apache Arrow is a cross-language development platform for in-memory data. It specifies a standardized language-independent columnar memory format for flat and hierarchical data, organized for efficient analytic operations on modern hardware. It also provides computational libraries and zero-copy streaming messaging and interprocess communication. Languages currently supported include C, C++, Java, JavaScript, Python, and Ruby.","fork":true,"url":"https://api.github.com/repos/nevi-me/arrow","forks_url":"https://api.github.com/repos/nevi-me/arrow/forks","keys_url":"https://api.github.com/repos/nevi-me/arrow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nevi-me/arrow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nevi-me/arrow/teams","hooks_url":"https://api.github.com/repos/nevi-me/arrow/hooks","issue_events_url":"https://api.github.com/repos/nevi-me/arrow/issues/events{/number}","events_url":"https://api.github.com/repos/nevi-me/arrow/events","assignees_url":"https://api.github.com/repos/nevi-me/arrow/assignees{/user}","branches_url":"https://api.github.com/repos/nevi-me/arrow/branches{/branch}","tags_url":"https://api.github.com/repos/nevi-me/arrow/tags","blobs_url":"https://api.github.com/repos/nevi-me/arrow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nevi-me/arrow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nevi-me/arrow/git/refs{/sha}","trees_url":"https://api.github.com/repos/nevi-me/arrow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nevi-me/arrow/statuses/{sha}","languages_url":"https://api.github.com/repos/nevi-me/arrow/languages","stargazers_url":"https://api.github.com/repos/nevi-me/arrow/stargazers","contributors_url":"https://api.github.com/repos/nevi-me/arrow/contributors","subscribers_url":"https://api.github.com/repos/nevi-me/arrow/subscribers","subscription_url":"https://api.github.com/repos/nevi-me/arrow/subscription","commits_url":"https://api.github.com/repos/nevi-me/arrow/commits{/sha}","git_commits_url":"https://api.github.com/repos/nevi-me/arrow/git/commits{/sha}","comments_url":"https://api.github.com/repos/nevi-me/arrow/comments{/number}","issue_comment_url":"https://api.github.com/repos/nevi-me/arrow/issues/comments{/number}","contents_url":"https://api.github.com/repos/nevi-me/arrow/contents/{+path}","compare_url":"https://api.github.com/repos/nevi-me/arrow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nevi-me/arrow/merges","archive_url":"https://api.github.com/repos/nevi-me/arrow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nevi-me/arrow/downloads","issues_url":"https://api.github.com/repos/nevi-me/arrow/issues{/number}","pulls_url":"https://api.github.com/repos/nevi-me/arrow/pulls{/number}","milestones_url":"https://api.github.com/repos/nevi-me/arrow/milestones{/number}","notifications_url":"https://api.github.com/repos/nevi-me/arrow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nevi-me/arrow/labels{/name}","releases_url":"https://api.github.com/repos/nevi-me/arrow/releases{/id}","deployments_url":"https://api.github.com/repos/nevi-me/arrow/deployments","created_at":"2018-08-07T14:10:04Z","updated_at":"2018-12-23T12:48:20Z","pushed_at":"2018-12-23T12:48:16Z","git_url":"git://github.com/nevi-me/arrow.git","ssh_url":"git@github.com:nevi-me/arrow.git","clone_url":"https://github.com/nevi-me/arrow.git","svn_url":"https://github.com/nevi-me/arrow","homepage":"https://arrow.apache.org","size":22802,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"6578089472958b20126d5c56fe8f8737b02b5544","user":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","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":51905353,"node_id":"MDEwOlJlcG9zaXRvcnk1MTkwNTM1Mw==","name":"arrow","full_name":"apache/arrow","private":false,"owner":{"login":"apache","id":47359,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzU5","avatar_url":"https://avatars0.githubusercontent.com/u/47359?v=4","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},"html_url":"https://github.com/apache/arrow","description":"Apache Arrow is a cross-language development platform for in-memory data. It specifies a standardized language-independent columnar memory format for flat and hierarchical data, organized for efficient analytic operations on modern hardware. It also provides computational libraries and zero-copy streaming messaging and interprocess communication. Languages currently supported include C, C++, Java, JavaScript, Python, and Ruby.","fork":false,"url":"https://api.github.com/repos/apache/arrow","forks_url":"https://api.github.com/repos/apache/arrow/forks","keys_url":"https://api.github.com/repos/apache/arrow/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/arrow/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/arrow/teams","hooks_url":"https://api.github.com/repos/apache/arrow/hooks","issue_events_url":"https://api.github.com/repos/apache/arrow/issues/events{/number}","events_url":"https://api.github.com/repos/apache/arrow/events","assignees_url":"https://api.github.com/repos/apache/arrow/assignees{/user}","branches_url":"https://api.github.com/repos/apache/arrow/branches{/branch}","tags_url":"https://api.github.com/repos/apache/arrow/tags","blobs_url":"https://api.github.com/repos/apache/arrow/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/arrow/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/arrow/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/arrow/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/arrow/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/arrow/languages","stargazers_url":"https://api.github.com/repos/apache/arrow/stargazers","contributors_url":"https://api.github.com/repos/apache/arrow/contributors","subscribers_url":"https://api.github.com/repos/apache/arrow/subscribers","subscription_url":"https://api.github.com/repos/apache/arrow/subscription","commits_url":"https://api.github.com/repos/apache/arrow/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/arrow/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/arrow/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/arrow/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/arrow/contents/{+path}","compare_url":"https://api.github.com/repos/apache/arrow/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/arrow/merges","archive_url":"https://api.github.com/repos/apache/arrow/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/arrow/downloads","issues_url":"https://api.github.com/repos/apache/arrow/issues{/number}","pulls_url":"https://api.github.com/repos/apache/arrow/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/arrow/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/arrow/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/arrow/labels{/name}","releases_url":"https://api.github.com/repos/apache/arrow/releases{/id}","deployments_url":"https://api.github.com/repos/apache/arrow/deployments","created_at":"2016-02-17T08:00:23Z","updated_at":"2018-12-23T00:37:34Z","pushed_at":"2018-12-23T12:48:18Z","git_url":"git://github.com/apache/arrow.git","ssh_url":"git@github.com:apache/arrow.git","clone_url":"https://github.com/apache/arrow.git","svn_url":"https://github.com/apache/arrow","homepage":"https://arrow.apache.org","size":22871,"stargazers_count":2981,"watchers_count":2981,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":752,"mirror_url":null,"archived":false,"open_issues_count":80,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":752,"open_issues":80,"watchers":2981,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/arrow/pulls/3128"},"html":{"href":"https://github.com/apache/arrow/pull/3128"},"issue":{"href":"https://api.github.com/repos/apache/arrow/issues/3128"},"comments":{"href":"https://api.github.com/repos/apache/arrow/issues/3128/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/arrow/pulls/3128/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/arrow/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/arrow/pulls/3128/commits"},"statuses":{"href":"https://api.github.com/repos/apache/arrow/statuses/8dbb0af88c460dde2651ffa6e879cb33f6c1dba1"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"nevi-me"}}