-
Notifications
You must be signed in to change notification settings - Fork 29k
SPARK-22896 Improvement in String interpolation #20070
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
Changes from 1 commit
9916fd1
162ac27
aa2de00
74d41d7
8d729fa
5507cad
79e6789
70ce734
0321faf
c33e90c
18d047f
e891f53
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,11 +42,11 @@ object LatentDirichletAllocationExample { | |
| val ldaModel = new LDA().setK(3).run(corpus) | ||
|
|
||
| // Output topics. Each is a distribution over words (matching word count vectors) | ||
| println("Learned topics (as distributions over vocab of " + ldaModel.vocabSize + " words):") | ||
| println(s"Learned topics (as distributions over vocab of ${ldaModel.vocabSize} words):") | ||
| val topics = ldaModel.topicsMatrix | ||
| for (topic <- Range(0, 3)) { | ||
| print("Topic " + topic + ":") | ||
| for (word <- Range(0, ldaModel.vocabSize)) { print(" " + topics(word, topic)); } | ||
| print(s"Topic $topic :") | ||
| for (word <- Range(0, ldaModel.vocabSize)) { print(s" ${topics(word, topic)}") } | ||
|
||
| println() | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -82,9 +82,9 @@ class CustomReceiver(host: String, port: Int) | |
| var socket: Socket = null | ||
| var userInput: String = null | ||
| try { | ||
| logInfo("Connecting to " + host + ":" + port) | ||
| logInfo(s"Connecting to $host $port") | ||
|
||
| socket = new Socket(host, port) | ||
| logInfo("Connected to " + host + ":" + port) | ||
| logInfo(s"Connected to $host : $port") | ||
| val reader = new BufferedReader( | ||
| new InputStreamReader(socket.getInputStream(), StandardCharsets.UTF_8)) | ||
| userInput = reader.readLine() | ||
|
|
@@ -98,7 +98,7 @@ class CustomReceiver(host: String, port: Int) | |
| restart("Trying to connect again") | ||
| } catch { | ||
| case e: java.net.ConnectException => | ||
| restart("Error connecting to " + host + ":" + port, e) | ||
| restart(s"Error connecting to $host : $port", e) | ||
| case t: Throwable => | ||
| restart("Error receiving data", t) | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.toString is redundant here and elsewhere with interpolation. I think that should be simplified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@srowen Thanks , Changes addressed