Skip to content

Conversation

@charlesbluca
Copy link
Collaborator

This restores the original consolidated computation of limit/offsets in limit_partition_func, while also opting to keep the simplified computation of limits when an offset is not specified, which is what we opted for in #529.

Closes #597

"""
# if no offset is specified we can use `head` to compute the window
if not offset:
return df.head(limit, npartitions=-1, compute=False)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ayushdg not sure if you'd prefer we check the first partition first to see if we can avoid the npartitions=-1 here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine to keep it as is and revisit if we encounter perf issues.

@codecov-commenter
Copy link

codecov-commenter commented Jun 24, 2022

Codecov Report

❗ No coverage uploaded for pull request base (datafusion-sql-planner@ba50d24). Click here to learn what that means.
The diff coverage is n/a.

@@                    Coverage Diff                    @@
##             datafusion-sql-planner     #598   +/-   ##
=========================================================
  Coverage                          ?   60.88%           
=========================================================
  Files                             ?       71           
  Lines                             ?     3566           
  Branches                          ?      730           
=========================================================
  Hits                              ?     2171           
  Misses                            ?     1246           
  Partials                          ?      149           

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

Copy link
Collaborator

@ayushdg ayushdg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot. Changes lgtm!

@charlesbluca charlesbluca merged commit 71e2917 into dask-contrib:datafusion-sql-planner Jul 19, 2022
@charlesbluca charlesbluca deleted the datafusion-update-limit branch July 19, 2022 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants