Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
Gets the DataFrame's current storage level.
Returns
StorageLevel
Examples
:::note Serverless compatibility
Databricks recommends moving away from df.cache() and df.persist() as they are not compatible with Databricks serverless compute architecture. Materialize intermediate results to Delta tables instead.
:::
df1 = spark.range(10)
df1.storageLevel
# StorageLevel(False, False, False, False, 1)
df1.cache().storageLevel
# StorageLevel(True, True, False, True, 1)
df2 = spark.range(5)
df2.persist(StorageLevel.DISK_ONLY_2).storageLevel
# StorageLevel(True, False, False, False, 2)