File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
flinkx-hive/flinkx-hive-core/src/main/java/com/dtstack/flinkx/hive/util Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ public final class HiveDbUtil {
6363 public static final String PARAM_DELIMITER = "&" ;
6464 public static final String KEY_PRINCIPAL = "principal" ;
6565
66- public static Pattern HIVE_JDBC_PATTERN = Pattern .compile ("(?i)jdbc:hive2://(?<host>[0-9a-zA-Z \\ . ]+):(?<port>\\ d+)/(?<db>[0-9a-z_% ]+)(?<param>[\\ ?;#].*)*" );
66+ public static Pattern HIVE_JDBC_PATTERN = Pattern .compile ("(?i)jdbc:hive2://(?<host>[^: ]+):(?<port>\\ d+)/(?<db>[^; ]+)(?<param>[\\ ?;#].*)*" );
6767 public static final String HOST_KEY = "host" ;
6868 public static final String PORT_KEY = "port" ;
6969 public static final String DB_KEY = "db" ;
@@ -264,7 +264,8 @@ public static String parseIpAndPort(String url) {
264264 if (matcher .find ()) {
265265 addr = matcher .group (HOST_KEY ) + ":" + matcher .group (PORT_KEY );
266266 } else {
267- addr = url .substring (url .indexOf ("//" ) + 2 , url .lastIndexOf ("/" ));
267+ addr = url .substring (url .indexOf ("//" ) + 2 );
268+ addr = addr .substring (0 ,addr .indexOf ("/" ));
268269 }
269270 return addr ;
270271 }
You can’t perform that action at this time.
0 commit comments