private void openSession(TOpenSessionReq openReq) throws TException, SQLException {
    TOpenSessionResp openResp = client.OpenSession(openReq);

    // Populate a given configuration from HS2 server HiveConf, only if that configuration
    // is not already present in Connection parameter HiveConf i.e., client side configuration
    // takes precedence over the server side configuration.
    Map<String, String> serverHiveConf = openResp.getConfiguration();

    updateServerHiveConf(serverHiveConf, connParams);

    // validate connection
    Utils.verifySuccess(openResp.getStatus());
    if (!supportedProtocols.contains(openResp.getServerProtocolVersion())) {
      throw new TException("Unsupported Hive2 protocol");
    }
    protocol = openResp.getServerProtocolVersion();
    sessHandle = openResp.getSessionHandle();

    ConfVars fetchSizeConf = ConfVars.HIVE_SERVER2_THRIFT_RESULTSET_DEFAULT_FETCH_SIZE;
    int serverFetchSize = Optional.ofNullable(openResp.getConfiguration().get(fetchSizeConf.varname))
        .map(size -> Integer.parseInt(size))
        .orElse(fetchSizeConf.defaultIntVal);
    if (serverFetchSize <= 0) {
      throw new IllegalStateException("Default fetch size must be greater than 0");
    }
    this.fetchSize = Optional.ofNullable(sessConfMap.get(JdbcConnectionParams.FETCH_SIZE))
        .map(size -> Integer.parseInt(size))
        .filter(v -> v > 0)
        .orElse(serverFetchSize);

    ConfVars fetchThreadsConf = ConfVars.HIVE_JDBC_FETCH_THREADS;
    int serverFetchThreads = Optional.ofNullable(openResp.getConfiguration().get(fetchThreadsConf.varname))
        .map(size -> Integer.parseInt(size))
        .orElse(fetchThreadsConf.defaultIntVal);
    if (serverFetchThreads <= 0) {
      throw new IllegalStateException("Default fetch threads must be >= 0");
    }
    this.fetchThreads = Optional.ofNullable(sessConfMap.get(JdbcConnectionParams.FETCH_THREADS))
        .map(size -> Integer.parseInt(size))
        .filter(v -> v >= 0)
        .orElse(serverFetchThreads);

  }
Create transport per the connection options
Supported transport options are:
  - SASL based transports over
     + Kerberos
     + Delegation token
     + SSL
     + non-SSL
  - Raw (non-SASL) socket

  Kerberos and Delegation token supports SASL QOP configurations
@throws SQLException, TTransportException
jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java