Skip to content

Feature: Add spark cache.count() and display limit for koalas #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add spark optim
  • Loading branch information
Vincent-Maladiere committed Mar 9, 2023
commit 9a64218c3cabf779baa9f649c517aba868f5c745
1 change: 1 addition & 0 deletions eds_scikit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def koalas_options() -> None:

ks.set_option("compute.default_index_type", "distributed")
ks.set_option("compute.ops_on_diff_frames", True)
ks.set_option("display.max_rows", 50)


def set_env_variables() -> None:
Expand Down
6 changes: 5 additions & 1 deletion eds_scikit/utils/custom_implem/custom_implem.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ def cache(cls, df, backend=None):
# no-op
return
elif backend is ks:
df.spark.cache()
# Cache using count(), a simple action that trigger the
# eager mode and effectively cache the dataframe.
# See this link for more details about the count trick:
# https://stackoverflow.com/a/44002485
df.spark.cache().count()
return
else:
raise NotImplementedError(
Expand Down