Github user manishgupta88 commented on a diff in the pull request: https://github.com/apache/carbondata/pull/2136#discussion_r179074922 --- Diff: integration/spark-common/src/main/scala/org/apache/carbondata/spark/rdd/CarbonScanRDD.scala --- @@ -438,7 +438,9 @@ class CarbonScanRDD( // for usage of unsafe method for processing of one blocklet and if there is any exception // while doing that the unsafe memory occupied for that task will not get cleared context.addTaskCompletionListener { _ => - reader.close() + if (reader != null) { + reader.close() + } --- End diff -- Remove null check and reader.close() call and call closeReader() method here
---