livy.session¶
-
class
livy.session.
LivySession
(url, auth=None, kind=<SessionKind.PYSPARK: 'pyspark'>, proxy_user=None, spark_conf=None, echo=True, check=True)[source]¶ Manages a remote Livy session and high-level interactions with it.
- Parameters
url (
str
) – The URL of the Livy server.kind (
SessionKind
) – The kind of session to create.proxy_user (
Optional
[str
]) – User to impersonate when starting the session.spark_conf (
Optional
[Dict
[str
,Any
]]) – Spark configuration properties.echo (
bool
) – Whether to echo output printed in the remote session. Defaults toTrue
.check (
bool
) – Whether to raise an exception when a statement in the remote session fails. Defaults toTrue
.
-
property
state
¶ The state of the managed Spark session.
- Return type
SessionState
-
run
(code)[source]¶ Run some code in the managed Spark session.
- Parameters
code (
str
) – The code to run.- Return type
Output