nxcals.api.custom.data.services.DataFrame.localCheckpoint
- DataFrame.localCheckpoint(eager: bool = True, storageLevel: StorageLevel | None = None) DataFrame
Returns a locally checkpointed version of this
DataFrame. Checkpointing can be used to truncate the logical plan of thisDataFrame, which is especially useful in iterative algorithms where the plan may grow exponentially. Local checkpoints are stored in the executors using the caching subsystem and therefore they are not reliable.Added in version 2.3.0.
Changed in version 4.0.0: Supports Spark Connect. Added storageLevel parameter.
- Parameters:
eager (bool, optional, default True) – Whether to checkpoint this
DataFrameimmediately.storageLevel (
StorageLevel, optional, default None) – The StorageLevel with which the checkpoint will be stored. If not specified, default for RDD local checkpoints.
- Returns:
Checkpointed DataFrame.
- Return type:
Notes
This API is experimental.
Examples
>>> df = spark.createDataFrame([ ... (14, "Tom"), (23, "Alice"), (16, "Bob")], ["age", "name"]) >>> df.localCheckpoint(False) DataFrame[age: bigint, name: string]