{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/15093","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/15093/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/15093/comments","events_url":"https://api.github.com/repos/apache/spark/issues/15093/events","html_url":"https://github.com/apache/spark/pull/15093","id":176902241,"number":15093,"title":"[SPARK-17480][SQL][FOLLOWUP] Fix more instances which calls List.length/size which is O(n)","user":{"login":"HyukjinKwon","id":6477701,"avatar_url":"https://avatars.githubusercontent.com/u/6477701?v=3","gravatar_id":"","url":"https://api.github.com/users/HyukjinKwon","html_url":"https://github.com/HyukjinKwon","followers_url":"https://api.github.com/users/HyukjinKwon/followers","following_url":"https://api.github.com/users/HyukjinKwon/following{/other_user}","gists_url":"https://api.github.com/users/HyukjinKwon/gists{/gist_id}","starred_url":"https://api.github.com/users/HyukjinKwon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HyukjinKwon/subscriptions","organizations_url":"https://api.github.com/users/HyukjinKwon/orgs","repos_url":"https://api.github.com/users/HyukjinKwon/repos","events_url":"https://api.github.com/users/HyukjinKwon/events{/privacy}","received_events_url":"https://api.github.com/users/HyukjinKwon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-09-14T13:06:39Z","updated_at":"2016-09-15T15:14:19Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/15093","html_url":"https://github.com/apache/spark/pull/15093","diff_url":"https://github.com/apache/spark/pull/15093.diff","patch_url":"https://github.com/apache/spark/pull/15093.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\nThis PR fixes all the instances which was fixed in the previous PR.\r\n\r\nTo make sure, I manually debugged and also checked the Scala source. `length` in [LinearSeqOptimized.scala#L49-L57](https://github.com/scala/scala/blob/2.11.x/src/library/scala/collection/LinearSeqOptimized.scala#L49-L57) is O(n). Also, `size` calls `length` via [SeqLike.scala#L106](https://github.com/scala/scala/blob/2.11.x/src/library/scala/collection/SeqLike.scala#L106).\r\n\r\nFor debugging, I have created these as below:\r\n\r\n```scala\r\nArrayBuffer(1, 2, 3)\r\nArray(1, 2, 3)\r\nList(1, 2, 3)\r\nSeq(1, 2, 3)\r\n```\r\n\r\nand then called `size` and `length` for each to debug.\r\n\r\n## How was this patch tested?\r\n\r\nI ran the bash as below on Mac\r\n\r\n```bash\r\nfind . -name *.scala -type f -exec grep -il \"while (.*\\\\.length)\" {} \\; | grep \"src/main\"\r\nfind . -name *.scala -type f -exec grep -il \"while (.*\\\\.size)\" {} \\; | grep \"src/main\"\r\n```\r\n\r\nand then checked each."},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/247357695","html_url":"https://github.com/apache/spark/pull/15093#issuecomment-247357695","issue_url":"https://api.github.com/repos/apache/spark/issues/15093","id":247357695,"user":{"login":"SparkQA","id":8108735,"avatar_url":"https://avatars.githubusercontent.com/u/8108735?v=3","gravatar_id":"","url":"https://api.github.com/users/SparkQA","html_url":"https://github.com/SparkQA","followers_url":"https://api.github.com/users/SparkQA/followers","following_url":"https://api.github.com/users/SparkQA/following{/other_user}","gists_url":"https://api.github.com/users/SparkQA/gists{/gist_id}","starred_url":"https://api.github.com/users/SparkQA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SparkQA/subscriptions","organizations_url":"https://api.github.com/users/SparkQA/orgs","repos_url":"https://api.github.com/users/SparkQA/repos","events_url":"https://api.github.com/users/SparkQA/events{/privacy}","received_events_url":"https://api.github.com/users/SparkQA/received_events","type":"User","site_admin":false},"created_at":"2016-09-15T15:14:19Z","updated_at":"2016-09-15T15:14:19Z","body":"**[Test build #65440 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/65440/consoleFull)** for PR 15093 at commit [`cb536a4`](https://github.com/apache/spark/commit/cb536a411784496a20ea71c0637639119d51ca95).\n * This patch passes all tests.\n * This patch merges cleanly.\n * This patch adds no public classes."}}
{"actor":{"display_login":"SparkQA"}}