private static String getMergedPropertiesString(Properties userConnectionProperties,
      String propertyKey, Map<String, String> propertiesFromJdbcConnParams)
      throws BeelineHS2ConnectionFileParseException {
    String properties = "";
    if ((userConnectionProperties != null) && (userConnectionProperties.containsKey(propertyKey))) {
      properties =
          extractHiveVariables((String) userConnectionProperties.remove(propertyKey), true);
    }
    String propertiesFromJdbcUri = "";
    for (Map.Entry<String, String> entry : propertiesFromJdbcConnParams.entrySet()) {
      if (!properties.contains(entry.getKey())) {
        if (!propertiesFromJdbcUri.isEmpty()) {
          propertiesFromJdbcUri = propertiesFromJdbcUri + ",";
        }
        propertiesFromJdbcUri = propertiesFromJdbcUri + entry.getKey() + "=" + entry.getValue();
      }
    }
    if (!propertiesFromJdbcUri.isEmpty()) {
      if (!properties.isEmpty()) {
        properties = properties + ",";
      }
      properties = properties + propertiesFromJdbcUri;
    }
    return properties;
  }
Merge the connection properties read from beeline-hs2-connection.xml with the
JdbcConnectionParams extracted from the jdbc url specified in beeline.xml

@param userConnectionProperties
@param jdbcConnectionParams
@return
@throws BeelineHS2ConnectionFileParseException
beeline/src/java/org/apache/hive/beeline/hs2connection/HS2ConnectionFileUtils.java