@Override
  public Properties getConnectionProperties() throws BeelineHS2ConnectionFileParseException {
    Properties props = new Properties();
    String fileLocation = getFileLocation();
    if (fileLocation == null) {
      log.debug("User connection configuration file not found");
      return props;
    }
    log.info("Using connection configuration file at " + fileLocation);
    props.setProperty(HS2ConnectionFileParser.URL_PREFIX_PROPERTY_KEY, "jdbc:hive2://");
    // load the properties from config file
    Configuration conf = new Configuration(false);
    conf.addResource(new Path(new File(fileLocation).toURI()));
    try {
      for (Entry<String, String> kv : conf) {
        String key = kv.getKey();
        if (key.startsWith(BEELINE_CONNECTION_PROPERTY_PREFIX)) {
          props.setProperty(key.substring(BEELINE_CONNECTION_PROPERTY_PREFIX.length()),
              kv.getValue());
        }
      }
    } catch (Exception ex) {
      throw new BeelineHS2ConnectionFileParseException(ex.getMessage(), ex);
    }

    return props;
  }
This class implements HS2ConnectionFileParser for the user-specific connection configuration
file named beeline-hs2-connection.xml. The class looks for this file in
${user.home}/.beeline, ${HIVE_CONF_DIR} or /etc/conf/hive in that order and uses the first file
found in the above locations.
beeline/src/java/org/apache/hive/beeline/hs2connection/UserHS2ConnectionFileParser.java