Skip to content

Streaming MySql ResultSet #552

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

Open
sananguliyev opened this issue Mar 21, 2021 · 10 comments
Open

Streaming MySql ResultSet #552

sananguliyev opened this issue Mar 21, 2021 · 10 comments
Assignees

Comments

@sananguliyev
Copy link

Hi,

I wanted to use MySQL proxy for big data analytics which sometimes takes a couple of hours to finish the execution have a full result. Is it possible to stream the ResultSet while the query is executing?

@atercattus
Copy link
Member

Hello, @sananguliyev.

There is Conn.ExecuteSelectStreaming which call callback for every row instead of saving the whole Resultset in memory.
https://github.com/go-mysql-org/go-mysql/blob/master/README.md#example-for-select-streaming-v111

Maybe this is what you want?

@sananguliyev
Copy link
Author

sananguliyev commented Apr 8, 2021

@atercattus it's what I need. I will test it. I do not know how I missed that. Thanks a lot.

EDIT: I have tested it but I could not do what I want to implement. I am currently using MySQL Server as a proxy and this method (https://github.com/go-mysql-org/go-mysql/blob/master/server/command.go#L16) should return the whole resultset.

@atercattus
Copy link
Member

Got it. Then the functionality requires improvement from my side.
We use streaming with "repacking" to another protocol :)

I'll make PR for you in the near future.

@sananguliyev
Copy link
Author

Thanks a lot. Looking forward to your PR.

@sananguliyev
Copy link
Author

Hi @atercattus is there any plan regarding to that enhancement? I could contribute in case you share your ideas how you plan to implement it.

@atercattus
Copy link
Member

I changed my work and didn't do this task when I was going to...
Thanks for your patience and this reminder. I will think over the issue before the end of the year. it's ok?

@sananguliyev
Copy link
Author

Yes, sure. It's totally ok. Thanks for update.

@sananguliyev
Copy link
Author

Hi @atercattus,

is there any update?

@skoef
Copy link
Contributor

skoef commented Apr 12, 2022

hey @sananguliyev, I recently worked on the streaming results from SELECT queries, since I had trouble implementing the initial design as well. Perhaps my refactor works better for you? #596

@sananguliyev
Copy link
Author

Thankd @skoef, it looks what I am looking for. I will check it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants