Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-4268][SQL] Use #::: to get benefit from Stream in SqlLexical.allCaseVersions #3132

Closed
wants to merge 1 commit into from

Conversation

zsxwing
Copy link
Member

@zsxwing zsxwing commented Nov 6, 2014

In addition, using s.isEmpty to eliminate the string comparison.

@SparkQA
Copy link

SparkQA commented Nov 6, 2014

Test build #22996 has started for PR 3132 at commit 358e235.

  • This patch merges cleanly.

@SparkQA
Copy link

SparkQA commented Nov 6, 2014

Test build #22996 has finished for PR 3132 at commit 358e235.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/22996/
Test PASSed.

Stream(prefix)
} else {
allCaseVersions(s.tail, prefix + s.head.toLower) ++
allCaseVersions(s.tail, prefix + s.head.toLower) #:::
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that these are all materialized eventually

Didn't realize it. However, then why not use List? Since laziness is not necessary, using Stream is confusing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a good point, I don't know why it is a Stream but I guess this change is okay.

@asfgit asfgit closed this in d3e02dd Dec 2, 2014
@zsxwing zsxwing deleted the SPARK-4268 branch December 2, 2014 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants