szlta opened a new pull request #1911:
URL: https://github.com/apache/hive/pull/1911


   HIVE-23840 introduced the feature of reading delete deltas from LLAP cache 
if it's available. This refactor opens an opportunity for NPE to happen:
   
   Caused by: java.lang.NullPointerException
   at 
org.apache.hadoop.hive.shims.Hadoop23Shims.getFileId(Hadoop23Shims.java:1410)
   at org.apache.hadoop.hive.ql.io.HdfsUtils.getFileId(HdfsUtils.java:55)
   at 
org.apache.hadoop.hive.llap.io.encoded.OrcEncodedDataReader.determineFileId(OrcEncodedDataReader.java:509)
   at 
org.apache.hadoop.hive.llap.io.encoded.OrcEncodedDataReader.getOrcTailForPath(OrcEncodedDataReader.java:579)
   at 
org.apache.hadoop.hive.llap.io.api.impl.LlapIoImpl.getOrcTailFromCache(LlapIoImpl.java:322)
   at 
org.apache.hadoop.hive.ql.io.orc.VectorizedOrcAcidRowBatchReader.getOrcTail(VectorizedOrcAcidRowBatchReader.java:683)
   at 
org.apache.hadoop.hive.ql.io.orc.VectorizedOrcAcidRowBatchReader.access$500(VectorizedOrcAcidRowBatchReader.java:82)
   at 
org.apache.hadoop.hive.ql.io.orc.VectorizedOrcAcidRowBatchReader$ColumnizedDeleteEventRegistry.<init>(VectorizedOrcAcidRowBatchReader.java:1581)
   ColumnizedDeleteEventRegistry infers the file name of a delete delta bucket 
by looking at the bucket number (from the corresponding split) but this file 
may not exist if no deletion happen from that particular bucket.
   
   Earlier this was handled by always trying to open an ORC reader on the path 
and catching FileNotFoundException. However in the refactor we first try to 
look into the cache, and for that try to retrieve a file ID first. This entails 
a getFileStatus call on HDFS which returns null for non-existing paths, causing 
the NPE eventually.
   
   This was later fixed by HIVE-23956, nevertheless Hadoop23Shims.getFileId 
should be refactored in a way that it's not error prone anymore.


----------------------------------------------------------------
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]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to