Skip to content
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

Removed limit from the test #5033

Merged
merged 3 commits into from
Mar 24, 2022
Merged
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
3 changes: 2 additions & 1 deletion integration_tests/src/main/python/cache_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,13 @@ def partial_return_cache(spark):

@pytest.mark.parametrize('enable_vectorized_conf', enable_vectorized_confs, ids=idfn)
@allow_non_gpu('CollectLimitExec')
@ignore_order
def test_cache_reverse_order(enable_vectorized_conf):
col0 = StructGen([['child0', StructGen([['child1', byte_gen]])]])
col1 = StructGen([['child0', byte_gen]])
def partial_return():
def partial_return_cache(spark):
return two_col_df(spark, col0, col1).select(f.col("a"), f.col("b")).cache().limit(50).select(f.col("b"), f.col("a"))
return two_col_df(spark, col0, col1).select(f.col("a"), f.col("b")).cache().select(f.col("b"), f.col("a"))
Copy link
Collaborator

@gerashegalov gerashegalov Mar 24, 2022

Choose a reason for hiding this comment

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

Is the order really guaranteed without limit? Adding @ignore_order test marker looks like a more intuitive solution to me

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That will only sort the collected list AFAIK which by the time it comes back to the driver is too late, no?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Or are you asking to add ignore_order in addition to the change? I can do that

Copy link
Collaborator

Choose a reason for hiding this comment

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

You are right about the local sort, but you can also say @ignore_order(local=False)

Copy link
Collaborator

Choose a reason for hiding this comment

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

and you are right about removing limit, since this ends up just sorting a non-deterministic subset instead of taking the head of a sorted list.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So, I would expect that to work but setting local=False still applies sort after the limit resulting in the test to fail.

As discussed offline, I will remove the limit and add ignore_order

return partial_return_cache
assert_gpu_and_cpu_are_equal_collect(partial_return(), conf=enable_vectorized_conf)

Expand Down