@Test
  public void testSetCommand() throws SQLException {
    // execute set command
    String sql = "set -v";
    Statement stmt = con.createStatement();
    ResultSet res = stmt.executeQuery(sql);

    // Validate resultset columns
    ResultSetMetaData md = res.getMetaData();
    assertEquals(1, md.getColumnCount());
    assertEquals(SET_COLUMN_NAME, md.getColumnLabel(1));

    // check if there is data in the resultset
    int numLines = 0;
    while (res.next()) {
      numLines++;
      String rline = res.getString(1);
      assertFalse(
          "set output must not contain hidden variables such as the metastore password:" + rline,
          rline.contains(HiveConf.ConfVars.METASTORE_PWD.varname)
              && !(rline.contains(HiveConf.ConfVars.HIVE_CONF_HIDDEN_LIST.varname)));
      // the only conf allowed to have the metastore pwd keyname is the hidden list configuration
      // value
    }
    assertTrue("Nothing returned by set -v", numLines > 0);

    res.close();
    stmt.close();
  }
validate schema generated by "set" command
@throws SQLException
itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java