snowflake.snowpark.DataFrame.cache_result¶
- DataFrame.cache_result(*, statement_params: Dict[str, str] | None = None) Table[source]¶
Caches the content of this DataFrame to create a new cached Table DataFrame.
All subsequent operations on the returned cached DataFrame are performed on the cached data and have no effect on the original DataFrame.
You can use
Table.drop_table()or thewithstatement to clean up the cached result when it’s not needed. Refer to the example code below.Note
An error will be thrown if a cached result is cleaned up and it’s used again, or any other DataFrames derived from the cached result are used again.
- Examples::
- Parameters:
statement_params – Dictionary of statement level parameters to be set while executing this action.
- Returns:
A
Tableobject that holds the cached result in a temporary table. All operations on this new DataFrame have no effect on the original.