Apache Spark Component Guide
Also available as:
PDF
loading table of contents...

Livy Objects for Interactive Sessions

Session Object

A session object represents an interactive shell:

PropertyDescriptionType
idA non-negative integer that represents a specific session of interestint
appIdApplication ID for this sessionstring
ownerRemote user who submitted this sessionstring
proxyUserUser ID to impersonate when runningstring
kindSession kind (see the following "kind" table for values)session kind
logLog file datalist of strings
stateSession state (see the following "state" table for values)string
appInfoDetailed application informationkey=value map

The following values are valid for the kind property in a session object:

ValueDescription
sparkInteractive Scala Spark session
pysparkInteractive Python 2 Spark session
pyspark3Interactive Python 3 Spark session
sparkrInteractive R Spark session

The following values are valid for the state property in a session object:

ValueDescription
not_startedSession has not started
startingSession is starting
idleSession is waiting for input
busySession is executing a statement
shutting_downSession is shutting down
errorSession terminated due to an error
deadSession exited
successSession successfully stopped

Statement Object

A statement object represents the result of an execution statement.

PropertyDescriptionType
idA non-negative integer that represents a specific statement of interestinteger
stateExecution state (see the following "state" table for values)statement state
outputExecution output (see the following "output" table for values)statement output

The following values are valid for the state property in a statement object:

valueDescription
waitingStatement is queued, execution has not started
runningStatement is running
availableStatement has a response ready
errorStatement failed
cancellingStatement is being cancelled
cancelledStatement is cancelled

The following values are valid for the output property in a statement object:

PropertyDescriptionType
statusExecution status, such as "starting", "idle", or "available".string
execution_countExecution countinteger (monotonically increasing)
dataStatement outputAn object mapping a mime type to the result. If the mime type is application/json, the value is a JSON value.