Github user aarondav commented on a diff in the pull request:
https://github.com/apache/spark/pull/267#discussion_r11323731
--- Diff: repl/src/main/scala/org/apache/spark/repl/SparkJLineReader.scala
---
@@ -78,3 +80,11 @@ class SparkJLineReader(_completion: => Completion)
extends InteractiveReader {
def readOneLine(prompt: String) = consoleReader readLine prompt
def readOneKey(prompt: String) = consoleReader readOneKey prompt
}
+
+/** Changes the default history file to not collide with the scala repl's.
*/
+class SparkJLineHistory extends JLineFileHistory {
+ import Properties.userHome
+
+ def defaultFileName = ".spark_history"
+ override protected lazy val historyFile = File(Path(userHome) /
defaultFileName)
--- End diff --
The reason I did this was to fully mimic the [code from the Scala
interpreter](https://github.com/scala/scala/blob/master/src/repl/scala/tools/nsc/interpreter/session/FileBackedHistory.scala#L77).
I think this will make it easier to compare in case the Scala version is
updated some time in the future, but you're right we could use a lighter weight
construct, we just risk having different behavior than the standard Scala shell
history.
Not a big deal to me, but I'm inclined to stick with cloning the Scala
shell behavior. Let me know if you still prefer the `java.io.File` route, I'd
be happy to change to that.
---
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.
---