This is an automated email from the ASF dual-hosted git repository.
zabetak pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git
The following commit(s) were added to refs/heads/master by this push:
new f94a6efbf5 HIVE-26139: Encode only '#' characters in
HBaseStorageHandler authorization URL (Steve Carlin, reviewed by Alessandro
Solimando, Stamatis Zampetakis)
f94a6efbf5 is described below
commit f94a6efbf5a37d82e6160ff816c86f7240f37a70
Author: Steve Carlin <[email protected]>
AuthorDate: Tue Apr 12 11:32:25 2022 -0700
HIVE-26139: Encode only '#' characters in HBaseStorageHandler authorization
URL (Steve Carlin, reviewed by Alessandro Solimando, Stamatis Zampetakis)
Remove the global encoding of the authorization URL since it has some
undesirable side effects.
Closes #3206
---
.../org/apache/hadoop/hive/hbase/HBaseStorageHandler.java | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git
a/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HBaseStorageHandler.java
b/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HBaseStorageHandler.java
index 03d455f095..b5cecccd49 100644
---
a/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HBaseStorageHandler.java
+++
b/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HBaseStorageHandler.java
@@ -19,10 +19,8 @@
package org.apache.hadoop.hive.hbase;
import java.io.IOException;
-import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
-import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
@@ -310,12 +308,9 @@ public class HBaseStorageHandler extends
DefaultStorageHandler
return new URI(URIString);
}
- private static String encodeString(String rawString) throws
URISyntaxException {
- try {
- return rawString != null ? URLEncoder.encode(rawString, "UTF-8"): null;
- } catch (UnsupportedEncodingException e) {
- throw new URISyntaxException(rawString, "Could not URLEncode string");
- }
+ private static String encodeString(String rawString) {
+ // Only url encode hash code value for now
+ return rawString != null ? rawString.replace("#", "%23") : null;
}
/**