You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by "Z1Wu (via GitHub)" <gi...@apache.org> on 2024/06/15 10:27:18 UTC

[PR] [KYUUBI #6469] Lazily initialize RecordReaderIterator to avoid driver oom when fetching big result set [kyuubi]

Z1Wu opened a new pull request, #6470:
URL: https://github.com/apache/kyuubi/pull/6470

   # :mag: Description
   ## Issue References 🔗
   <!-- Append the issue number after #. If there is no issue for you to link create one or -->
   <!-- If there are no issues to link, please provide details here. -->
   
   This pull request fixes https://github.com/apache/kyuubi/issues/6469
   
   ## Describe Your Solution 🔧
   
   Instead of initializing all RecordReaderIterator when create OrcFileIterator,we can lazily initialize the RecordReaderIterator to make sure that there is only one RecordReaderIterator which reads file current fetching by client in driver memory.
   
   
   ## Types of changes :bookmark:
   <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
   - [x] Bugfix (non-breaking change which fixes an issue)
   - [ ] New feature (non-breaking change which adds functionality)
   - [ ] Breaking change (fix or feature that would cause existing functionality to change)
   
   ## Test Plan 🧪
   
   #### Behavior Without This Pull Request :coffin:
   
   
   #### Behavior With This Pull Request :tada:
   
   
   #### Related Unit Tests
   
   
   ---
   
   # Checklist 📝
   <!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
   <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
   
   - [x] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


Re: [PR] [KYUUBI #6469] Lazily initialize RecordReaderIterator to avoid driver oom when fetching big result set [kyuubi]

Posted by "cxzl25 (via GitHub)" <gi...@apache.org>.
cxzl25 commented on code in PR #6470:
URL: https://github.com/apache/kyuubi/pull/6470#discussion_r1642125778


##########
externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/FetchOrcStatement.scala:
##########
@@ -74,37 +75,44 @@ class FetchOrcStatement(spark: SparkSession) {
   }
 }
 
-class OrcFileIterator(fileList: ListBuffer[LocatedFileStatus]) extends Iterator[OrcStruct] {
-
-  private val iters = fileList.map(x => getOrcFileIterator(x))
+class OrcFileIterator(fileList: ListBuffer[LocatedFileStatus]) extends Iterator[OrcStruct]
+  with Logging {

Review Comment:
   It looks like `Logging` is not used.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


Re: [PR] [KYUUBI #6469] Lazily initialize RecordReaderIterator to avoid driver oom when fetching big result set [kyuubi]

Posted by "Z1Wu (via GitHub)" <gi...@apache.org>.
Z1Wu commented on code in PR #6470:
URL: https://github.com/apache/kyuubi/pull/6470#discussion_r1642152366


##########
externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/FetchOrcStatement.scala:
##########
@@ -74,37 +75,44 @@ class FetchOrcStatement(spark: SparkSession) {
   }
 }
 
-class OrcFileIterator(fileList: ListBuffer[LocatedFileStatus]) extends Iterator[OrcStruct] {
-
-  private val iters = fileList.map(x => getOrcFileIterator(x))
+class OrcFileIterator(fileList: ListBuffer[LocatedFileStatus]) extends Iterator[OrcStruct]
+  with Logging {

Review Comment:
   removed



##########
externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/FetchOrcStatement.scala:
##########
@@ -74,37 +75,44 @@ class FetchOrcStatement(spark: SparkSession) {
   }
 }
 
-class OrcFileIterator(fileList: ListBuffer[LocatedFileStatus]) extends Iterator[OrcStruct] {
-
-  private val iters = fileList.map(x => getOrcFileIterator(x))
+class OrcFileIterator(fileList: ListBuffer[LocatedFileStatus]) extends Iterator[OrcStruct]
+  with Logging {
 
   var idx = 0

Review Comment:
   fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


Re: [PR] [KYUUBI #6469] Lazily initialize RecordReaderIterator to avoid driver oom when fetching big result set [kyuubi]

Posted by "cxzl25 (via GitHub)" <gi...@apache.org>.
cxzl25 commented on code in PR #6470:
URL: https://github.com/apache/kyuubi/pull/6470#discussion_r1642127021


##########
externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/operation/FetchOrcStatement.scala:
##########
@@ -74,37 +75,44 @@ class FetchOrcStatement(spark: SparkSession) {
   }
 }
 
-class OrcFileIterator(fileList: ListBuffer[LocatedFileStatus]) extends Iterator[OrcStruct] {
-
-  private val iters = fileList.map(x => getOrcFileIterator(x))
+class OrcFileIterator(fileList: ListBuffer[LocatedFileStatus]) extends Iterator[OrcStruct]
+  with Logging {
 
   var idx = 0

Review Comment:
   nit private



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org


Re: [PR] [KYUUBI #6469] Lazily initialize RecordReaderIterator to avoid driver oom when fetching big result set [kyuubi]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #6470:
URL: https://github.com/apache/kyuubi/pull/6470#issuecomment-2172092158

   ## [Codecov](https://app.codecov.io/gh/apache/kyuubi/pull/6470?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   Attention: Patch coverage is `0%` with `16 lines` in your changes missing coverage. Please review.
   > Project coverage is 0.00%. Comparing base [(`95ed748`)](https://app.codecov.io/gh/apache/kyuubi/commit/95ed74821c3a2d3a3f402033de7b463966a4bc28?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`56284e6`)](https://app.codecov.io/gh/apache/kyuubi/commit/56284e68e8c65f3ebfec7d0444caa0892bf9ad64?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   > Report is 1 commits behind head on master.
   
   | [Files](https://app.codecov.io/gh/apache/kyuubi/pull/6470?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...ubi/engine/spark/operation/FetchOrcStatement.scala](https://app.codecov.io/gh/apache/kyuubi/pull/6470?src=pr&el=tree&filepath=externals%2Fkyuubi-spark-sql-engine%2Fsrc%2Fmain%2Fscala%2Forg%2Fapache%2Fkyuubi%2Fengine%2Fspark%2Foperation%2FFetchOrcStatement.scala&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZXh0ZXJuYWxzL2t5dXViaS1zcGFyay1zcWwtZW5naW5lL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUva3l1dWJpL2VuZ2luZS9zcGFyay9vcGVyYXRpb24vRmV0Y2hPcmNTdGF0ZW1lbnQuc2NhbGE=) | 0.00% | [16 Missing :warning: ](https://app.codecov.io/gh/apache/kyuubi/pull/6470?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@          Coverage Diff           @@
   ##           master   #6470   +/-   ##
   ======================================
     Coverage    0.00%   0.00%           
   ======================================
     Files         675     675           
     Lines       41643   41647    +4     
     Branches     5685    5686    +1     
   ======================================
   - Misses      41643   41647    +4     
   ```
   
   
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/kyuubi/pull/6470?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org