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-22896 Improvement in String interpolation #20070

Closed
wants to merge 12 commits into from
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ object HypothesisTestingExample {
// against the label.
val featureTestResults: Array[ChiSqTestResult] = Statistics.chiSqTest(obs)
featureTestResults.zipWithIndex.foreach { case (k, v) =>
println(s"Column ${(v + 1).toString} :")
println(s"Column ${(v + 1)} :")
println(k)
} // summary of the test
// $example off$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ object LatentDirichletAllocationExample {
val topics = ldaModel.topicsMatrix
for (topic <- Range(0, 3)) {
print(s"Topic $topic :")
for (word <- Range(0, ldaModel.vocabSize)) { print(s" ${topics(word, topic)}") }
for (word <- Range(0, ldaModel.vocabSize))
{
Copy link
Member

Choose a reason for hiding this comment

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

No, we put the open brace on the preceding line with for, and don't triple indent. See any other for loop in the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@srowen sure done.

print(s" ${topics(word, topic)}")
}
println()
}

Expand Down