All Downloads are FREE. Search and download functionalities are using the official Maven repository.

almond.spark.syntax.scala Maven / Gradle / Ivy

package almond.spark

import almond.display.Html
import org.apache.spark.sql._
import org.apache.spark.{SparkConf, SparkContext}

object syntax {
  implicit class KernelToreeSparkOps(private val kernel: almond.api.JupyterApi) {
    def sparkContext: SparkContext = sparkSession.sparkContext
    def sparkConf: SparkConf       = sparkContext.getConf
    def sparkSession: SparkSession = SparkSession.builder().getOrCreate()
  }
  implicit class AlmondNetflixDataFrameOps(private val df: DataFrame) {
    def render(limit: Int = 10): Html =
      Html(DataFrameRenderer.render(df, limit = limit))
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy