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

<lazyframe>$group_by()$agg()$collect() may hang #23

Open
eitsupi opened this issue Oct 20, 2024 · 3 comments
Open

<lazyframe>$group_by()$agg()$collect() may hang #23

eitsupi opened this issue Oct 20, 2024 · 3 comments

Comments

@eitsupi
Copy link
Owner

eitsupi commented Oct 20, 2024

I noticed this example will hang.

as_polars_df(mtcars)$group_by("cyl", foo = TRUE)$agg()

This is not confirmed by Python Polars or current R Polars.
It may occur if some feature flag is missing, but I have not been able to identify it (Enabling several features did not solve the problem.).

@eitsupi
Copy link
Owner Author

eitsupi commented Oct 20, 2024

It hangs.

as_polars_df(mtcars)$group_by(1:2, foo = TRUE)$agg()

It works.

as_polars_df(data.frame(a = 1:10))$group_by(1:2, foo = TRUE)$agg()

It works.

as_polars_df(data.frame(a = 1:14))$group_by(1:2, foo = TRUE)$agg()

It hangs.

as_polars_df(data.frame(a = 1:15))$group_by(1:2, foo = TRUE)$agg()

It works.

as_polars_df(mtcars[1:14, ])$group_by(1:2, foo = TRUE)$agg()

I don't know why, but it seems to hang if the original data frame has more than 15 rows???

@eitsupi
Copy link
Owner Author

eitsupi commented Oct 20, 2024

Hmmm, it works.

as_polars_lf(mtcars)$group_by(1:2, foo = TRUE)$agg()$collect(streaming = TRUE)

It hangs.

as_polars_lf(mtcars)$group_by(1:2, foo = TRUE)$agg()$collect(streaming = FALSE)

@eitsupi
Copy link
Owner Author

eitsupi commented Oct 21, 2024

I think we need to implement this part to cancel hanged queries.

// TODO: uncomment this block
// let res_res = extendr_api::eval_string("Sys.sleep(0)");
// if res_res.is_err() {
// r_println!("R user interrupt");
// return Err("interupt by user".into());
// }

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

No branches or pull requests

1 participant