Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module defines session objects that act as entry points to spark.
There are two ways to interact with Spark: using an explicit state object, or using the default state object (interactive session).
While the interactive session is the most convenient, it should not be used for more than quick experimentations. Any complex code should use the SparkSession and SparkState objects.
- data SparkSessionConf = SparkSessionConf {}
- data SparkSession
- type SparkState a = LoggingT (StateT SparkSession IO) a
- data SparkInteractiveException
- class FromSQL a
- defaultConf :: SparkSessionConf
- executeCommand1 :: forall a. (FromSQL a, HasCallStack) => LocalData a -> SparkState (Try a)
- createSparkSessionDef :: HasCallStack => SparkSessionConf -> IO ()
- closeSparkSessionDef :: HasCallStack => IO ()
- exec1Def :: (FromSQL a, HasCallStack) => LocalData a -> IO a
Documentation
data SparkSessionConf Source #
The configuration of a remote spark session in krapsh.
SparkSessionConf | |
|
data SparkSession Source #
A session in Spark. Encapsualates all the state needed to communicate with Spark and to perfor some simple optimizations on the code.
type SparkState a = LoggingT (StateT SparkSession IO) a Source #
Represents the state of a session and accounts for the communication with the server.
data SparkInteractiveException Source #
The exception thrown when a request cannot be completed in an interactive session.
defaultConf :: SparkSessionConf Source #
The default configuration if the krapsh server is being run locally.
executeCommand1 :: forall a. (FromSQL a, HasCallStack) => LocalData a -> SparkState (Try a) Source #
Executes a command: - performs the transforms and the optimizations in the pure state - sends the computation to the backend - waits for the terminal nodes to reach a final state - commits the final results to the state
If any failure is detected that is internal to Krapsh, it returns an error. If the error comes from an underlying library (http stack, programming failure), an exception may be thrown instead.
createSparkSessionDef :: HasCallStack => 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.
closeSparkSessionDef :: HasCallStack => 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.