diff --git a/shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java b/shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java index 0483e91..475ae31 100644 --- a/shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java +++ b/shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java @@ -1148,7 +1148,8 @@ public HdfsEncryptionShim(URI uri, Configuration conf) throws IOException { DistributedFileSystem dfs = (DistributedFileSystem)FileSystem.get(uri, conf); this.conf = conf; - this.keyProvider = dfs.getClient().getKeyProvider(); + this.keyProvider = dfs.getClient().isHDFSEncryptionEnabled() ? + dfs.getClient().getKeyProvider() : null; this.hdfsAdmin = new HdfsAdmin(uri, conf); }