[GitHub] [carbondata] QiangCai commented on a change in pull request #3804: [CARBONDATA-3871] Optimize performance when getting row from heap
QiangCai commented on a change in pull request #3804: URL: https://github.com/apache/carbondata/pull/3804#discussion_r446910728 ## File path: processing/src/main/java/org/apache/carbondata/processing/merger/RowResultMergerProcessor.java ## @@ -126,7 +125,7 @@ public boolean execute(List unsortedResultIteratorList, RawResultIterator iterator = null; while (index > 1) { // iterator the top record -iterator = this.recordHolderHeap.poll(); +iterator = this.recordHolderHeap.peek(); Object[] convertedRow = iterator.next(); if (null == convertedRow) { index--; Review comment: insert code: this.recordHolderHeap.poll(); 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [carbondata] QiangCai commented on a change in pull request #3804: [CARBONDATA-3871] Optimize performance when getting row from heap
QiangCai commented on a change in pull request #3804: URL: https://github.com/apache/carbondata/pull/3804#discussion_r446839075 ## File path: processing/src/main/java/org/apache/carbondata/processing/loading/sort/unsafe/merger/UnsafeInMemoryIntermediateDataMerger.java ## @@ -141,25 +140,26 @@ private UnsafeCarbonRowForMerge getSortedRecordFromMemory() { // be based on comparator we are passing the heap // when will call poll it will always delete root of the tree and then // it does trickel down operation complexity is log(n) -UnsafeInmemoryMergeHolder poll = this.recordHolderHeap.poll(); +UnsafeInmemoryMergeHolder poll = this.recordHolderHeap.peek(); // get the row from chunk row = poll.getRow(); // check if there no entry present if (!poll.hasNext()) { + this.recordHolderHeap.poll(); Review comment: to release resource, invoke this.recordHolderHeap.close() 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org