karps-0.2.0.0: Haskell bindings for Spark Dataframes and Datasets

Safe HaskellNone
LanguageHaskell2010

Spark.Core.Internal.ContextInteractive

Description

Functions to create and manipulate one default context.

This is most appropriate when working in an interactive session, during which it is usually clear that there is a single Spark context in use.

This module uses unsafe Haskell code that should not be used outside prototyping in an interactive REPL. In any good case, you should use the SparkState monad.

Synopsis

Documentation

createSparkSessionDef :: SparkSessionConf -> IO () Source #

Creates a spark session that will be used as the default session.

If a session already exists, an exception will be thrown.

exec1Def :: FromSQL a => LocalData a -> IO a Source #

Executes a command using the default spark session.

This is the most unsafe way of running a command: it executes a command using the default spark session, and throws an exception if any error happens.

closeSparkSessionDef :: IO () Source #

Closes the default session. The default session is empty after this call completes.

NOTE: This does not currently clear up the resources! It is a stub implementation used in testing.

execStateDef :: SparkState a -> IO a Source #

Runs the computation described in the state transform, using the default Spark session.

Will throw an exception if no session currently exists.