Github user marmbrus commented on a diff in the pull request:
https://github.com/apache/spark/pull/3132#discussion_r20033708
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/SparkSQLParser.scala
---
@@ -97,10 +97,10 @@ class SqlLexical(val keywords: Seq[String]) extends
StdLexical {
/** Generate all variations of upper and lower case of a given string */
def allCaseVersions(s: String, prefix: String = ""): Stream[String] = {
- if (s == "") {
+ if (s.isEmpty) {
Stream(prefix)
} else {
- allCaseVersions(s.tail, prefix + s.head.toLower) ++
+ allCaseVersions(s.tail, prefix + s.head.toLower) #:::
--- End diff --
Why is this better? Because its lazy? Given that these are all
materialized eventually the possible benefit seems dubious given the drop in
readability. (Please correct me if I'm wrong).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]