SparkCalculation

org.terminal21.sparklib.calculations.SparkCalculation
See theSparkCalculation companion object
case class SparkCalculation[OUT](key: String, dataUi: UiElement & HasStyle, toUi: OUT => UiElement & HasStyle, cached: Cached[OUT], dataStore: TypedMap)(implicit evidence$1: ReadWriter[OUT], spark: SparkSession, session: ConnectedSession, events: Events) extends UiComponent

A UI component that takes a spark calculation (i.e. a spark query) that results in a Dataset. It caches the results by storing them as parquet into the tmp folder/spark-calculations/$name. Next time the calculation runs it reads the cache if available. A button should allow the user to clear the cache and rerun the spark calculations in case the data changed.

Because the cache is stored in the disk, it is available even if the jvm running the code restarts. This allows the user to run and rerun their code without having to rerun the spark calculation.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait UiComponent
class UiElement
trait AnyElement
class Object
trait Matchable
class Any
Show all

Members list

Type members

Types

override type This = SparkCalculation[OUT]

Value members

Concrete methods

def name: String
override def rendered: Seq[UiElement]

Attributes

Definition Classes
UiComponent
override def withDataStore(ds: TypedMap): This

Attributes

Definition Classes
UiElement
override def withKey(key: String): This

Attributes

Definition Classes
UiElement

Inherited methods

def findKey(key: String): UiElement

Attributes

Inherited from:
UiElement
override def flat: Seq[UiElement]

Attributes

Returns

this element along all it's children flattened

Definition Classes
UiComponent -> UiElement
Inherited from:
UiComponent
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
def store[V](key: TypedMapKey[V], value: V): This

Attributes

Inherited from:
UiElement
def storedValue[V](key: TypedMapKey[V]): V

Attributes

Inherited from:
UiElement
protected def subKey(suffix: String): String

Attributes

Inherited from:
UiComponent
def substituteComponents: UiElement

Attributes

Inherited from:
UiElement
def toSimpleString: String

Attributes

Inherited from:
UiElement

Concrete fields

val recalc: Button