[ https://issues.apache.org/jira/browse/HIVE-26015?focusedWorklogId=739288&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-739288 ]
ASF GitHub Bot logged work on HIVE-26015: ----------------------------------------- Author: ASF GitHub Bot Created on: 10/Mar/22 05:42 Start Date: 10/Mar/22 05:42 Worklog Time Spent: 10m Work Description: scarlin-cloudera commented on a change in pull request #3084: URL: https://github.com/apache/hive/pull/3084#discussion_r823365104 ########## File path: hbase-handler/src/java/org/apache/hadoop/hive/hbase/HBaseStorageHandler.java ########## @@ -296,7 +297,8 @@ public URI getURIForAuth(Table table) throws URISyntaxException { String hbase_host = tableProperties.containsKey(HBASE_HOST_NAME)? tableProperties.get(HBASE_HOST_NAME) : hbaseConf.get(HBASE_HOST_NAME); String hbase_port = tableProperties.containsKey(HBASE_CLIENT_PORT)? tableProperties.get(HBASE_CLIENT_PORT) : hbaseConf.get(HBASE_CLIENT_PORT); String table_name = tableProperties.getOrDefault(HBaseSerDe.HBASE_TABLE_NAME, null); - String column_family = tableProperties.getOrDefault(HBaseSerDe.HBASE_COLUMNS_MAPPING, null); + String column_family = + URLEncoder.encode(tableProperties.getOrDefault(HBaseSerDe.HBASE_COLUMNS_MAPPING, null)); if (column_family != null) return new URI(HBASE_PREFIX+"//"+hbase_host+":"+hbase_port+"/"+table_name+"/"+column_family); Review comment: Oh, I just wrote the whole comment above addressing this before I saw yours. Please read what I wrote above. Perhaps it is better to encode the whole string? I just was worried about backward compatibility and the potential for URL Encoding characters that might get by in the URI...For instance, we found that one "#" characters worked fine in Serde properties, but we only hit the problem when there were 2 '#' characters. I'm a bit worried about breaking something. -- 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. To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 739288) Time Spent: 50m (was: 40m) > HBase table with Ranger authentication fails; needs URLEncoding > --------------------------------------------------------------- > > Key: HIVE-26015 > URL: https://issues.apache.org/jira/browse/HIVE-26015 > Project: Hive > Issue Type: New Feature > Reporter: Steve Carlin > Assignee: Steve Carlin > Priority: Major > Labels: pull-request-available > Time Spent: 50m > Remaining Estimate: 0h > > A Create table statement is failing for HBase going through Ranger. > The stack trace shows a problem with the getURIForAuth method. > The table is creating someting like this: > CREATE EXTERNAL TABLE `mytesttbl`( `field1` string COMMENT 'from > deserializer',`field2` string COMMENT 'from deserializer',`field3` string > COMMENT 'from deserializer',`field4` string COMMENT 'from > deserializer',`field5` string COMMENT 'from deserializer',`field6` int > COMMENT 'from deserializer', `field7` string COMMENT 'from deserializer', > `field8` int COMMENT 'from deserializer') ROW FORMAT SERDE > 'org.apache.hadoop.hive.hbase.HBaseSerDe' STORED BY > 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' WITH SERDEPROPERTIES ( > 'hbase.columns.mapping'=':key,field1,field2,field3,field4,field5#b,field6,cf:field7#b','serialization.format'='1') > TBLPROPERTIES ( 'hbase.table.name'='mytesttbl'); > Essentially, the SERDEPROPERTIES contain hash tabs which is causing a problem > when creating a URI -- This message was sent by Atlassian Jira (v8.20.1#820001)