spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ZHANG Wei <wezh...@outlook.com>
Subject Re: Is there any way to set the location of the history for the spark-shell per session?
Date Fri, 17 Apr 2020 02:29:51 GMT
You are welcome!

It's not in Spark sourcecode. It's in Scala source:

https://github.com/scala/scala/blob/2.11.x/src/repl-jline/scala/tools/nsc/interpreter/jline/FileBackedHistory.scala#L26

Reference Code:

  // For a history file in the standard location, always try to restrict permission,
  // creating an empty file if none exists.
  // For a user-specified location, only lock down permissions if we're the ones
  // creating it, otherwise responsibility for permissions is up to the caller.
  protected lazy val historyFile: File = File {
    propOrNone("scala.shell.histfile").map(Path.apply) match {
      case Some(p) => if (!p.exists) secure(p) else p
      case None => secure(Path(userHome) / FileBackedHistory.defaultFileName)
    }
  }

Cheers,
-z

________________________________________
From: Yeikel <email@yeikel.com>
Sent: Friday, April 17, 2020 5:24
To: user@spark.apache.org
Subject: Re: Is there any way to set the location of the history for the spark-shell per session?

Thank you. That's what I was looking for.

I only found a PR from Scala when I googled it , so if you remember your
source , please do so.

Thanks!




--
Sent from: http://apache-spark-user-list.1001560.n3.nabble.com/

---------------------------------------------------------------------
To unsubscribe e-mail: user-unsubscribe@spark.apache.org


---------------------------------------------------------------------
To unsubscribe e-mail: user-unsubscribe@spark.apache.org


Mime
View raw message