Zhangshunyu commented on a change in pull request #3644: [CARBONDATA-3727] Fix
NPE of sort merger
URL: https://github.com/apache/carbondata/pull/3644#discussion_r386013017
##########
File path:
processing/src/main/java/org/apache/carbondata/processing/sort/sortdata/SingleThreadFinalSortFilesMerger.java
##########
@@ -306,7 +306,7 @@ private IntermediateSortTempRow getSortedRecordFromFile()
throws CarbonDataWrite
* @return more element is present
*/
public boolean hasNext() {
- return this.recordHolderHeapLocal.size() > 0;
+ return this.recordHolderHeapLocal != null &&
this.recordHolderHeapLocal.size() > 0;
Review comment:
@ajantha-bhat after bucket table optimized and working fine can this NPE
problem be exposed, so the test cases added with bucket table feature test
cases in another pr based on bucket working. By the way, from code anylyse we
alse can find this parameter might be null without npe checking.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services