Copilot commented on code in PR #7317:
URL: https://github.com/apache/kyuubi/pull/7317#discussion_r2742664015
##########
kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/Utils.java:
##########
@@ -568,7 +568,13 @@ public static String parsePropertyFromUrl(final String
url, final String key) {
String[] tokens = url.split(";");
for (String token : tokens) {
if (token.trim().startsWith(key.trim() + "=")) {
- return token.trim().substring((key.trim() + "=").length());
+ String value = token.trim().substring((key.trim() + "=").length());
+ // Remove query string part (anything after ?) to match
extractURLComponents behavior
+ int queryIndex = value.indexOf('?');
+ if (queryIndex > 0) {
Review Comment:
The condition `queryIndex > 0` will fail to handle query strings at the
start of the value (e.g., `?param=value`). Change the condition to `queryIndex
>= 0` to correctly handle all cases where a query string is present, including
when it appears at position 0.
```suggestion
if (queryIndex >= 0) {
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]