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

Thejas M Nair commented on HIVE-9957:
-------------------------------------

[~spena] Thanks for fix! However, there is one improvement that can be made in 
this fix. Exceptions are expensive, so rather than throwing them every time, we 
can use this design pattern followed for some other functions in Hadoop23Shims 
- 

{code}
  protected static final Method accessMethod;
  protected static final Method getPasswordMethod;

  static {
    Method m = null;
    try {
      m = FileSystem.class.getMethod("access", Path.class, FsAction.class);
    } catch (NoSuchMethodException err) {
      // This version of Hadoop does not support FileSystem.access().
    }
    accessMethod = m;

    try {
      m = Configuration.class.getMethod("getPassword", String.class);
    } catch (NoSuchMethodException err) {
      // This version of Hadoop does not support getPassword(), just retrieve 
password from conf.
      m = null;
    }
    getPasswordMethod = m;
  }
{code}

Would you be able to make that improvement ? We can use a new jira for that.


> Hive 1.1.0 not compatible with Hadoop 2.4.0
> -------------------------------------------
>
>                 Key: HIVE-9957
>                 URL: https://issues.apache.org/jira/browse/HIVE-9957
>             Project: Hive
>          Issue Type: Bug
>          Components: Encryption
>            Reporter: Vivek Shrivastava
>            Assignee: Sergio Peña
>             Fix For: 1.2.0
>
>         Attachments: HIVE-9957.1.patch
>
>
> Getting this exception while accessing data through Hive. 
> Exception in thread "main" java.lang.NoSuchMethodError: 
> org.apache.hadoop.hdfs.DFSClient.getKeyProvider()Lorg/apache/hadoop/crypto/key/KeyProvider;
>         at 
> org.apache.hadoop.hive.shims.Hadoop23Shims$HdfsEncryptionShim.<init>(Hadoop23Shims.java:1152)
>         at 
> org.apache.hadoop.hive.shims.Hadoop23Shims.createHdfsEncryptionShim(Hadoop23Shims.java:1279)
>         at 
> org.apache.hadoop.hive.ql.session.SessionState.getHdfsEncryptionShim(SessionState.java:392)
>         at 
> org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.isPathEncrypted(SemanticAnalyzer.java:1756)
>         at 
> org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.getStagingDirectoryPathname(SemanticAnalyzer.java:1875)
>         at 
> org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.getMetaData(SemanticAnalyzer.java:1689)
>         at 
> org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.getMetaData(SemanticAnalyzer.java:1427)
>         at 
> org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.genResolvedParseTree(SemanticAnalyzer.java:10132)
>         at 
> org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:10147)
>         at 
> org.apache.hadoop.hive.ql.parse.CalcitePlanner.analyzeInternal(CalcitePlanner.java:192)
>         at 
> org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:222)
>         at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:421)
>         at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:307)
>         at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1112)
>         at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1160)
>         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1049)
>         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1039)
>         at 
> org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:207)
>         at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:159)
>         at 
> org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:370)
>         at 
> org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:754)
>         at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:675)
>         at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:615)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:606)
>         at org.apache.hadoop.util.RunJar.main(RunJar.java:212)



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

Reply via email to