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

[Improvement] Trino engine will save the result set all in memory, even if the incremental collect mode selected #2285

Closed
3 tasks done
iodone opened this issue Apr 6, 2022 · 1 comment
Assignees
Milestone

Comments

@iodone
Copy link
Contributor

iodone commented Apr 6, 2022

Code of Conduct

Search before asking

  • I have searched in the issues and found no similar issues.

What would you like to be improved?

The advantage of the trino engine is the ability to stream returned data, kyuubi as a proxy should not remove this feature, storing the result set all in memory will lead to performance and OOM problems.
https://github.com/apache/incubator-kyuubi/blob/6a231519454c5d75aca2120de140c06febf7ae54/externals/kyuubi-trino-engine/src/main/scala/org/apache/kyuubi/engine/trino/TrinoStatement.scala#L81-L135

The iterator in this code is a direct conversion of ArrayBuffer, not a real stream iterator, and in each call to getNextResultSet, there is no real call to Trino.client to get the next result each time. @hddong WDYT?

How should we improve?

  1. Trino's proxy implementation should be based entirely on the incremental collect model.
  2. Based on IterableFetchIterator to implement Trino DataResult Iterator, we can refer to Trino-JDBC's ResultSet implementation.

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@yaooqinn
Copy link
Member

yaooqinn commented Apr 6, 2022

I suggest we shall always not hold data at engine side in any mode

@yaooqinn yaooqinn added this to the v1.6.0 milestone Apr 12, 2022
iodone added a commit to iodone/kyuubi that referenced this issue May 17, 2022
iodone added a commit to iodone/kyuubi that referenced this issue May 17, 2022
iodone added a commit to iodone/kyuubi that referenced this issue May 18, 2022
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

2 participants