aboutsummaryrefslogtreecommitdiff
path: root/core/src/test/scala/org
diff options
context:
space:
mode:
authorhyukjinkwon <gurwls223@gmail.com>2016-09-17 16:52:30 +0100
committerSean Owen <sowen@cloudera.com>2016-09-17 16:52:30 +0100
commit86c2d393a56bf1e5114bc5a781253c0460efb8af (patch)
tree781bed6a1c59c58ac3b5d6bcd76b48aeb56e9098 /core/src/test/scala/org
parentbbe0b1d623741decce98827130cc67eb1fff1240 (diff)
downloadspark-86c2d393a56bf1e5114bc5a781253c0460efb8af.tar.gz
spark-86c2d393a56bf1e5114bc5a781253c0460efb8af.tar.bz2
spark-86c2d393a56bf1e5114bc5a781253c0460efb8af.zip
[SPARK-17480][SQL][FOLLOWUP] Fix more instances which calls List.length/size which is O(n)
## What changes were proposed in this pull request? This PR fixes all the instances which was fixed in the previous PR. To 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). For debugging, I have created these as below: ```scala ArrayBuffer(1, 2, 3) Array(1, 2, 3) List(1, 2, 3) Seq(1, 2, 3) ``` and then called `size` and `length` for each to debug. ## How was this patch tested? I ran the bash as below on Mac ```bash find . -name *.scala -type f -exec grep -il "while (.*\\.length)" {} \; | grep "src/main" find . -name *.scala -type f -exec grep -il "while (.*\\.size)" {} \; | grep "src/main" ``` and then checked each. Author: hyukjinkwon <gurwls223@gmail.com> Closes #15093 from HyukjinKwon/SPARK-17480-followup.
Diffstat (limited to 'core/src/test/scala/org')
0 files changed, 0 insertions, 0 deletions