You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "aturoczy (via GitHub)" <gi...@apache.org> on 2023/05/15 10:49:03 UTC

[GitHub] [hive] aturoczy commented on a diff in pull request #4323: HIVE-27344: Add a null check in RecordReaderImpl.close()

aturoczy commented on code in PR #4323:
URL: https://github.com/apache/hive/pull/4323#discussion_r1193663171


##########
ql/src/java/org/apache/hadoop/hive/ql/io/orc/RecordReaderImpl.java:
##########
@@ -165,7 +165,9 @@ public boolean nextBatch(VectorizedRowBatch theirBatch) throws IOException {
   public void close() throws IOException {
     super.close();
     // free the memory for the column vectors
-    batch.cols = null;
+    if (batch != null) {

Review Comment:
   It is fine. Personally I like more the following syntax, it is bit more readable to me. (You do **not** need to change) 
   ```
   if(batch == null)
      return;
   batch.cols = null
   ```



-- 
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: gitbox-unsubscribe@hive.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org