-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Manage data_spark_columns to avoid creating very many Spark DataFrame…
…s. (#1554) This PR makes huge changes on the way of `InternalFrame` management to avoid creating very many Spark DataFrames. It will make a lot of DataFrame operations without enabling "compute.ops_on_diff_frames" option possible. ```py df + df + df df['foo'] = df['bar']['baz'] df[['x', 'y']] = df[['x', 'y']].fillna(0) ``` The new way in functions to manage `InternalFrame` is: - If the function only needs to handle Spark columns, e.g., functions using `InternalFrame. with_new_columns`, use the new columns without creating new Spark DataFrame. Basically we can just use the `with_new_columns` to create a new `InternalFrame`. - If the function needs to create a new Spark DataFrame, e.g., functions need filter, order, groupby, use `_internal.spark_frame` with columns from `_internal.spark_column_for`. Working with a Spark DataFrame from `_internal.spark_frame` and column names from `_internal.spark_column_name_for` will usually NOT work. - If the function can only access by the column name, e.g., `pivot_table` or functions with udfs, use `_internal.applied.spark_frame` instead. The `_internal.applied.spark_frame` will be applied all the changes. Note that the `_internal.applied.spark_frame` won't work with Spark columns from `_internal.spark_column_for`. - `DataFrame._sdf` was removed to explicitly specify which `spark_frame` should be used, `_internal.spark_frame` or `_internal.applied.spark_frame`.
- Loading branch information
Showing
14 changed files
with
319 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.