Hi,
It's been a couple of times already when I ran into a code like the
following ([1]):
val isCommand = plan.find {
case _: Command | _: ParsedStatement | _: InsertIntoDir => true
case _ => false
}.isDefined
I think that this and the other places beg (scream?) for TreeNode.exists
that could do the simplest thing possible:
find(f).isDefined
or even
collectFirst(...).isDefined
It'd surely help a lot for people like myself reading the code. WDYT?
[1]
https://github.com/apache/spark/pull/33671/files#diff-4d16a733f8741de9a4b839ee7c356c3e9b439b4facc70018f5741da1e930c6a8R51-R54
Pozdrawiam,
Jacek Laskowski
----
https://about.me/JacekLaskowski
"The Internals Of" Online Books <https://books.japila.pl/>
Follow me on https://twitter.com/jaceklaskowski
<https://twitter.com/jaceklaskowski>