diff --git a/beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileUtils.java b/beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileUtils.java index 7c064cfda9..7fbb00a868 100644 --- a/beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileUtils.java +++ b/beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileUtils.java @@ -131,20 +131,23 @@ public static String getNamedUrl(Properties userNamedConnectionURLs, String urlN jdbcURL = userNamedConnectionURLs.getProperty(urlName); if (jdbcURL == null) { throw new BeelineSiteParseException( - "The named url: " + urlName + " is not specified in the connection configuration file: " + "The named url --> " + urlName + " <-- is not specified in the connection configuration file: " + BeelineSiteParser.DEFAULT_BEELINE_SITE_FILE_NAME); } return jdbcURL; } else { // Try to read the default named url from the connection configuration file - String defaultURLName = userNamedConnectionURLs - .getProperty(BeelineSiteParser.DEFAULT_NAMED_JDBC_URL_PROPERTY_KEY); + String defaultURLName = + userNamedConnectionURLs.getProperty(BeelineSiteParser.DEFAULT_NAMED_JDBC_URL_PROPERTY_KEY); jdbcURL = userNamedConnectionURLs.getProperty(defaultURLName); if (jdbcURL != null) { return jdbcURL; + } else { + throw new BeelineSiteParseException( + "The --> default <-- named url is not properly specified in the connection configuration file: " + + BeelineSiteParser.DEFAULT_BEELINE_SITE_FILE_NAME); } } - return null; } /**