[ 
https://issues.apache.org/jira/browse/HIVE-8090?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14133399#comment-14133399
 ] 

Rahul Palamuttam commented on HIVE-8090:
----------------------------------------

I followed the comment guidelines in CompressionCodec.java.

/**                                                                             
                                                                                
                                                                            
   * Produce a modified compression codec if the underlying algorithm allows    
                                                                                
                                                                              
   * modification.                                                              
                                                                                
                                                                              
   *                                                                            
                                                                                
                                                                              
   * This does not modify the current object, but returns a new object if       
                                                                                
                                                                              
   * modifications are possible. Returns the same object if no modifications    
                                                                                
                                                                              
   * are possible.                                                              
                                                                                
                                                                              
   * @param modifiers compression modifiers                                     
                                                                                
                                                                              
   * @return codec for use after optional modification                          
                                                                                
                                                                              
   */
  CompressionCodec modify(EnumSet<Modifier> modifiers);

Thus if modifiers are null then no modifications are possible. 
As per the comment the function returns the same object.
Waiting for code review.

> Potential null pointer reference in WriterImpl#StreamFactory#createStream()
> ---------------------------------------------------------------------------
>
>                 Key: HIVE-8090
>                 URL: https://issues.apache.org/jira/browse/HIVE-8090
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Ted Yu
>         Attachments: HIVE-8090.1.patch, HIVE-8090.2.patch, HIVE-8090.3.patch
>
>
> {code}
>       switch (kind) {
> ...
>       default:
>         modifiers = null;
>         break;
>       }
>       BufferedStream result = streams.get(name);
>       if (result == null) {
>         result = new BufferedStream(name.toString(), bufferSize,
>             codec == null ? codec : codec.modify(modifiers));
> {code}
> In case modifiers is null and codec is ZlibCodec, there would be NPE in 
> ZlibCodec#modify(EnumSet<Modifier> modifiers) :
> {code}
>     for (Modifier m : modifiers) {
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to