You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "mszurap (via GitHub)" <gi...@apache.org> on 2025/03/18 17:13:28 UTC

[PR] HIVE-28826: Beeline fails to connect with spaces in the jdbc url [hive]

mszurap opened a new pull request, #5701:
URL: https://github.com/apache/hive/pull/5701

   ### What changes were proposed in this pull request?
   In some environments we need to customize the javax.jdo.option.ConnectionURL, and typically with Oracle databases the JDBC connection URL might contain spaces, like
   
   jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS_LIST=...
   
   This is not handled by beeline, so hive schema upgrades are failing.
   
   For the Oracle JDBC driver at least, the URL escaping does not work. The proposed solution is to remove the whitespaces from the connection url before passing the url to the Commands.java:
   https://github.com/mszurap/hive/blob/2d528556b69c1ec011e83f69d2a2fdcfb78b356e/beeline/src/java/org/apache/hive/beeline/Commands.java#L1521.
   
   Spaces were not respected before in the connection url. However if spaces are needed in the connection URL (like in ";sslTrustStore=/path/to/mydir with spaces/truststore.jks" or "?tez.application.tags=A B") then the URL escaping with "%20" can be still used in those places, those are decoded properly back to spaces.
   
   ### Why are the changes needed?
   To make the upgades more robust, we should handle these situations.
   
   ### Does this PR introduce _any_ user-facing change?
   No
   
   ### Is the change a dependency upgrade?
   No
   
   ### How was this patch tested?
   Added a new beeline test "testSimpleArgsWithSpaceInUrl" to test the functionality that the spaces are now removed from the connection url ("-u" argument only).
   The beeline unit tests were successful.


-- 
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-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28826: Beeline fails to connect with spaces in the jdbc url [hive]

Posted by "mszurap (via GitHub)" <gi...@apache.org>.
mszurap commented on PR #5701:
URL: https://github.com/apache/hive/pull/5701#issuecomment-3190884555

   @nrg4878 @abstractdog do you have suggestions how to proceed further? 
   Do you have objections agains removing all the spaces from the URL? (by definition, URLs cannot contain spaces, they need to be encoded).


-- 
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-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28826: Beeline fails to connect with spaces in the jdbc url [hive]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #5701: HIVE-28826: Beeline fails to connect with spaces in the jdbc url
URL: https://github.com/apache/hive/pull/5701


-- 
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-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28826: Beeline fails to connect with spaces in the jdbc url [hive]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5701:
URL: https://github.com/apache/hive/pull/5701#issuecomment-2734311378

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5701) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [4 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5701&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5701&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5701&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5701&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5701&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5701)
   
   


-- 
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-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28826: Beeline fails to connect with spaces in the jdbc url [hive]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #5701:
URL: https://github.com/apache/hive/pull/5701#issuecomment-2771334619

   ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5701) **Quality Gate passed**  
   Issues  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [4 New issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5701&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=5701&issueStatuses=ACCEPTED)
   
   Measures  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=5701&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5701&metric=new_coverage&view=list)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=5701&metric=new_duplicated_lines_density&view=list)  
     
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=5701)
   
   


-- 
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-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28826: Beeline fails to connect with spaces in the jdbc url [hive]

Posted by "mszurap (via GitHub)" <gi...@apache.org>.
mszurap commented on PR #5701:
URL: https://github.com/apache/hive/pull/5701#issuecomment-2838705557

   @abstractdog @Aggarwal-Raghav as mentioned, this fix does not break the current workloads as even now the spaces are not tolerated by beeline. Can you advise how should we proceed? Do we need to refactor everything just to support the spaces in the  ";sess_var_list?hive_conf_list#hive_var_list" section?


-- 
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-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28826: Beeline fails to connect with spaces in the jdbc url [hive]

Posted by "mszurap (via GitHub)" <gi...@apache.org>.
mszurap commented on PR #5701:
URL: https://github.com/apache/hive/pull/5701#issuecomment-2742740533

   Yeah.
   - Right now, beeline fails to connect if there are spaces anywhere - because the "string".split(" ") skews the parameters
   - With the fix, we remove the spaces, so that could cause problems in such situations (in the given example the directory without spaces might not exist), but as mentioned we have a manual workaround at least with urlencoding the spaces. 
   
   I'm not sure if we need to address those very edge cases.


-- 
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-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28826: Beeline fails to connect with spaces in the jdbc url [hive]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5701:
URL: https://github.com/apache/hive/pull/5701#issuecomment-3092657938

   This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
   Feel free to reach out on the dev@hive.apache.org list if the patch is in need of reviews.


-- 
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-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28826: Beeline fails to connect with spaces in the jdbc url [hive]

Posted by "Aggarwal-Raghav (via GitHub)" <gi...@apache.org>.
Aggarwal-Raghav commented on PR #5701:
URL: https://github.com/apache/hive/pull/5701#issuecomment-2751684070

   @mszurap, i believe that removing all the whitespaces is not the way forward. As JDBC URL consists of:
   `JDBC URL: jdbc:hive2://<host>:<port>/dbName;sess_var_list?hive_conf_list#hive_var_list`
   
   in _hive_var_list_, users can have custom configs based on their use-case. If any config value expect space separated values then it becomes a breaking change for users and they have to explicilty provide "**_%20_**" as you mentioned above.


-- 
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-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28826: Beeline fails to connect with spaces in the jdbc url [hive]

Posted by "dengzhhu653 (via GitHub)" <gi...@apache.org>.
dengzhhu653 commented on code in PR #5701:
URL: https://github.com/apache/hive/pull/5701#discussion_r2348100245


##########
beeline/src/java/org/apache/hive/beeline/BeeLine.java:
##########
@@ -900,6 +900,8 @@ private boolean connectUsingArgs(BeelineParser beelineParser, CommandLine cl) {
     getOpts().setScriptFile(cl.getOptionValue("f"));
 
     if (url != null) {
+      //remove white spaces in the URL in case there is any, like in "jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS_LIST=..."
+      url = url.replaceAll("\\s+","");

Review Comment:
   Personally I would like not to make any change on the input url, that is, the beeline can accept the url whatever the user provides. If the beeline cannot parse the url correctly, then the user should make changes to fit into the Beeline, either replacing the namespace with %20 or removing the space from the jdo connection url.
   



-- 
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-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28826: Beeline fails to connect with spaces in the jdbc url [hive]

Posted by "abstractdog (via GitHub)" <gi...@apache.org>.
abstractdog commented on PR #5701:
URL: https://github.com/apache/hive/pull/5701#issuecomment-2742514123

   thanks for this patch @mszurap
   this patch makes sense to me, only 1 note regarding:
   ```
   sslTrustStore=/path/to/mydir with spaces/truststore.jks
   ```
   even if I hate to see spaces in folder names, we need to clarify if those scenarios will fail after this patch or not, I mean it wasn't clear that the URL encoding is a manual workaround for this or if it's handled by beeline somehow


-- 
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-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28826: Beeline fails to connect with spaces in the jdbc url [hive]

Posted by "mszurap (via GitHub)" <gi...@apache.org>.
mszurap commented on PR #5701:
URL: https://github.com/apache/hive/pull/5701#issuecomment-2752013188

   Hi @Aggarwal-Raghav , thanks for looking at this.
   Not as an excuse, but even now, if there is a space anywhere in the ";sess_var_list?hive_conf_list#hive_var_list" part, the string.split will split it and this usecase breaks even now, anybody wanting that already needs to escape the spaces.
   
   If we want to support spaces in the ";sess_var_list?hive_conf_list#hive_var_list" part too, then:
   1. we either need to refactor the whole code to avoid the string splitting by space and pass the parameters in a different way to the "Commands" (haven't explored how complex is this)
   2. or we use the same approach but carefully, we can skip removing the spaces after the semicolon, the question mark or the hashtag sign. Would you agree to this rather?


-- 
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-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28826: Beeline fails to connect with spaces in the jdbc url [hive]

Posted by "nrg4878 (via GitHub)" <gi...@apache.org>.
nrg4878 commented on code in PR #5701:
URL: https://github.com/apache/hive/pull/5701#discussion_r2279253455


##########
beeline/src/java/org/apache/hive/beeline/BeeLine.java:
##########
@@ -900,6 +900,8 @@ private boolean connectUsingArgs(BeelineParser beelineParser, CommandLine cl) {
     getOpts().setScriptFile(cl.getOptionValue("f"));
 
     if (url != null) {
+      //remove white spaces in the URL in case there is any, like in "jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS_LIST=..."

Review Comment:
   @mszurap JDBC URLs can also contain passwords where it is legal to have spaces in passwords. It would fail in such cases if we remove all spaces in the URL.
   Shouldnt we argue that user should not use spaces when not needed?



-- 
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-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28826: Beeline fails to connect with spaces in the jdbc url [hive]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #5701: HIVE-28826: Beeline fails to connect with spaces in the jdbc url
URL: https://github.com/apache/hive/pull/5701


-- 
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-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28826: Beeline fails to connect with spaces in the jdbc url [hive]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5701:
URL: https://github.com/apache/hive/pull/5701#issuecomment-3535165848

   This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
   Feel free to reach out on the dev@hive.apache.org list if the patch is in need of reviews.


-- 
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-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28826: Beeline fails to connect with spaces in the jdbc url [hive]

Posted by "mszurap (via GitHub)" <gi...@apache.org>.
mszurap commented on code in PR #5701:
URL: https://github.com/apache/hive/pull/5701#discussion_r2307080759


##########
beeline/src/java/org/apache/hive/beeline/BeeLine.java:
##########
@@ -900,6 +900,8 @@ private boolean connectUsingArgs(BeelineParser beelineParser, CommandLine cl) {
     getOpts().setScriptFile(cl.getOptionValue("f"));
 
     if (url != null) {
+      //remove white spaces in the URL in case there is any, like in "jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS_LIST=..."

Review Comment:
   For the reference, from a lab cluster, the connection fails if there is any space in the URL:
   ```
   beeline -u 'jdbc:hive2://zk1:2181,zk2:2181,zk3:2181/default;password=hive with spaces;serviceDiscoveryMode=zooKeeper;user=hive;zooKeeperNamespace=hiveserver2' --verbose
   ...
   !connect jdbc:hive2://zk1:2181,zk2:2181,zk3:2181/default;password=hive with spaces;serviceDiscoveryMode=zooKeeper;user=hive;zooKeeperNamespace=hiveserver2 hive [passwd stripped]
   Connecting to jdbc:hive2://zk1:2181,zk2:2181,zk3:2181/default;password=hive
   java.lang.ClassNotFoundException: hive
           at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
   ...
           at org.apache.hive.beeline.BeeLine.execCommandWithPrefix(BeeLine.java:1463)
           at org.apache.hive.beeline.BeeLine.dispatch(BeeLine.java:1502)
           at org.apache.hive.beeline.BeeLine.connectUsingArgs(BeeLine.java:922)
           at org.apache.hive.beeline.BeeLine.initArgs(BeeLine.java:804)
           at org.apache.hive.beeline.BeeLine.begin(BeeLine.java:1115)
           at org.apache.hive.beeline.BeeLine.begin(BeeLine.java:1089)
           at org.apache.hive.beeline.BeeLine.mainWithInputRedirection(BeeLine.java:547)
           at org.apache.hive.beeline.BeeLine.main(BeeLine.java:529)
   ...
   0: jdbc:hive2://hs2 (closed)> Connection is already closed.
   ```
   In this example, as previously explained, the username "hive" became the driver class name due to the skew in the arguments.
   The fact that there are spaces in the URL immediately caused the problem with our customer too, this is the primary reason for this fix too. We cannot have spaces anywhere, not even in the passwords. 



-- 
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-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28826: Beeline fails to connect with spaces in the jdbc url [hive]

Posted by "mszurap (via GitHub)" <gi...@apache.org>.
mszurap commented on code in PR #5701:
URL: https://github.com/apache/hive/pull/5701#discussion_r2306707185


##########
beeline/src/java/org/apache/hive/beeline/BeeLine.java:
##########
@@ -900,6 +900,8 @@ private boolean connectUsingArgs(BeelineParser beelineParser, CommandLine cl) {
     getOpts().setScriptFile(cl.getOptionValue("f"));
 
     if (url != null) {
+      //remove white spaces in the URL in case there is any, like in "jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS_LIST=..."

Review Comment:
   @nrg4878 let's say we do not replace all the spaces, but only those before the semicolon or question mark or hashtag (special characters are `;?#`) Like
   ```
       if (url != null) {
         url = removeSpacesFromURLBeforeFirstSpecialChar(url);
   ```
   Then we need to adjust the test code to the below, which shows the problem with the spaces in the url: this will cause the command line arguments to be skewed:
   ```
       String args2[] = new String[] {"-u", "url with space;pw=Pw with spaces", "-n", "name",
           "-p", "password", "-d", "driver", "-a", "authType"};
       org.junit.Assert.assertEquals(0, bl.initArgs(args2));
       Assert.assertTrue(bl.connectArgs.equals("urlwithspace;pw=Pw with spaces name password driver"));
       Assert.assertTrue(bl.getOpts().getAuthType().equals("authType"));
   ```
   the "with" becomes the username, "spaces" becomes the password, "name" becomes the driver.
   This would happen even right now, in the current Hive code if someone would use spaces anywhere in the URL.



-- 
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-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


Re: [PR] HIVE-28826: Beeline fails to connect with spaces in the jdbc url [hive]

Posted by "dengzhhu653 (via GitHub)" <gi...@apache.org>.
dengzhhu653 commented on code in PR #5701:
URL: https://github.com/apache/hive/pull/5701#discussion_r2348100245


##########
beeline/src/java/org/apache/hive/beeline/BeeLine.java:
##########
@@ -900,6 +900,8 @@ private boolean connectUsingArgs(BeelineParser beelineParser, CommandLine cl) {
     getOpts().setScriptFile(cl.getOptionValue("f"));
 
     if (url != null) {
+      //remove white spaces in the URL in case there is any, like in "jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS_LIST=..."
+      url = url.replaceAll("\\s+","");

Review Comment:
   Personally I would like not to make any change on the input url, that is, the beeline can accept the url whatever the user provides. If the beeline cannot parse the url correctly, then the user should make changes to fit into the Beeline, either replacing the namespace with %20 or removing the spaces from the jdo connection url.
   



-- 
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-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org