[ https://issues.apache.org/jira/browse/HIVE-22813?focusedWorklogId=850996&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-850996 ]
ASF GitHub Bot logged work on HIVE-22813: ----------------------------------------- Author: ASF GitHub Bot Created on: 14/Mar/23 21:18 Start Date: 14/Mar/23 21:18 Worklog Time Spent: 10m Work Description: scarlin-cloudera commented on code in PR #4112: URL: https://github.com/apache/hive/pull/4112#discussion_r1136218383 ########## ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java: ########## @@ -2589,15 +2589,17 @@ private boolean isPathEncrypted(Path path) throws HiveException { * @throws HiveException If an error occurs while comparing key strengths. */ private int comparePathKeyStrength(Path p1, Path p2) throws HiveException { - HadoopShims.HdfsEncryptionShim hdfsEncryptionShim; + try { + HadoopShims.HdfsEncryptionShim hdfsEncryptionShim1; + HadoopShims.HdfsEncryptionShim hdfsEncryptionShim2; + hdfsEncryptionShim1 = SessionState.get().getHdfsEncryptionShim(p1.getFileSystem(conf), conf); + hdfsEncryptionShim2 = SessionState.get().getHdfsEncryptionShim(p2.getFileSystem(conf), conf); - hdfsEncryptionShim = SessionState.get().getHdfsEncryptionShim(); - if (hdfsEncryptionShim != null) { - try { - return hdfsEncryptionShim.comparePathKeyStrength(p1, p2); - } catch (Exception e) { - throw new HiveException("Unable to compare key strength for " + p1 + " and " + p2 + " : " + e, e); + if (hdfsEncryptionShim1 != null && hdfsEncryptionShim2 != null) { + return hdfsEncryptionShim1.comparePathKeyStrength(p1, p2, hdfsEncryptionShim2); Review Comment: This seems a little unbalanced to me, passing in shim2 and using it there. What do you think about calling a method called compareKeyStrengthWithNulls(EncryptionZone zone1, EncryptionZone zone2), and adding the null check there. And then do the call for "genEncryptionZoneForPath(Path) here? Issue Time Tracking ------------------- Worklog Id: (was: 850996) Time Spent: 0.5h (was: 20m) > Hive query fails if table location is in remote EZ and it's readonly > -------------------------------------------------------------------- > > Key: HIVE-22813 > URL: https://issues.apache.org/jira/browse/HIVE-22813 > Project: Hive > Issue Type: Bug > Reporter: Purshotam Shah > Assignee: Purshotam Shah > Priority: Major > Labels: pull-request-available > Attachments: HIVE-22813.patch > > Time Spent: 0.5h > Remaining Estimate: 0h > > {code} > [purushah@gwrd352n21 ~]$ hive > hive> select * from puru_db.page_view_ez; > FAILED: SemanticException Unable to compare key strength for > hdfs://nn1/<>/puru_db_ez/page_view_ez and > hdfs://nn2:8020/tmp/puru/d558ac89-1359-424c-92ee-d0fefa8e6593/hive_2020-01-31_19-46-55_114_6449454330429555522-1/-mr-10000 > : java.lang.IllegalArgumentException: Wrong FS: > hdfs://nn1:8020/<>/puru_db_ez/page_view_ez, expected: hdfs://nn2 > hive> > {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)