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

Stream::count returns 1 #244

Closed
minborg opened this issue Apr 6, 2022 · 2 comments
Closed

Stream::count returns 1 #244

minborg opened this issue Apr 6, 2022 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@minborg
Copy link
Contributor

minborg commented Apr 6, 2022

A user reports 1 always being returned from:

jpaStreamer.stream(SomeEntity.class).count();

But the table in question contains a large number of rows. This was using Oracle DB.

@minborg minborg added the bug Something isn't working label Apr 6, 2022
@minborg minborg self-assigned this Apr 6, 2022
@ParthaNath28
Copy link

The sql query which is printed in the console once when I enable show-sql and that is working fine. When I change the count logic to return jpaStreamer.stream(Entity.class).toList().stream().count(); it is giving me correct record count but the performance is very slow. It took me 3 minutes to return the count of 24 thousand records perhaps may be due to the fact of object streaming of the entire record set.

@doriangrelu
Copy link

I have the same issue with an H2 Database...

@julgus julgus added question Further information is requested next and removed question Further information is requested labels Sep 1, 2022
@julgus julgus removed the next label Sep 1, 2022
@julgus julgus self-assigned this Sep 9, 2022
@julgus julgus closed this as completed in 1586727 Sep 30, 2022
@julgus julgus added this to the 1.1.0 milestone Sep 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants