Package org.apache.hadoop.hive.ql

Examples of org.apache.hadoop.hive.ql.Driver.run()


      if (proc != null) {
        if (proc instanceof Driver) {
          Driver qp = (Driver) proc;
          qp.setTryCount(Integer.MAX_VALUE);
          try {
          queryRet.add(Integer.valueOf(qp.run(cmd).getResponseCode()));
          ArrayList<String> res = new ArrayList<String>();
          try {
            while (qp.getResults(res)) {
              ArrayList<String> resCopy = new ArrayList<String>();
              resCopy.addAll(res);
View Full Code Here


      SessionState.start(ss);

      String cmd = "select a.key from src a";
      Driver d = new Driver(conf);
      int ret = d.run(cmd).getResponseCode();
      if (ret != 0) {
        fail("Failed");
      }
      HiveHistoryViewer hv = new HiveHistoryViewer(SessionState.get()
          .getHiveHistory().getHistFileName());
View Full Code Here

  public void test() throws MetaException, CommandNeedRetryException, IOException, ClassNotFoundException {

    HiveConf conf = new HiveConf(getClass());
    Driver driver = new Driver(conf);
    SessionState.start(new CliSessionState(conf));
    driver.run("drop table mytbl");
    driver.run("create table mytbl (a string, b int)");
    Iterator<Entry<String,String>> itr = conf.iterator();
    Map<String,String> map = new HashMap<String, String>();
    while(itr.hasNext()){
      Entry<String,String> kv = itr.next();
View Full Code Here

    HiveConf conf = new HiveConf(getClass());
    Driver driver = new Driver(conf);
    SessionState.start(new CliSessionState(conf));
    driver.run("drop table mytbl");
    driver.run("create table mytbl (a string, b int)");
    Iterator<Entry<String,String>> itr = conf.iterator();
    Map<String,String> map = new HashMap<String, String>();
    while(itr.hasNext()){
      Entry<String,String> kv = itr.next();
      map.put(kv.getKey(), kv.getValue());
View Full Code Here

    conf.set(ConfVars.SEMANTIC_ANALYZER_HOOK.varname, DummySemanticAnalyzerHook.class.getName());
    conf.set(ConfVars.HIVE_SUPPORT_CONCURRENCY.varname, "false");
    SessionState.start(conf);
    Driver driver = new Driver(conf);

    driver.run("drop table testDL");
    CommandProcessorResponse resp = driver.run("create table testDL (a int) as select * from tbl2");
    assertEquals(10, resp.getResponseCode());
    assertTrue(resp.getErrorMessage().contains("CTAS not supported."));

    resp = driver.run("create table testDL (a int)");
View Full Code Here

    conf.set(ConfVars.HIVE_SUPPORT_CONCURRENCY.varname, "false");
    SessionState.start(conf);
    Driver driver = new Driver(conf);

    driver.run("drop table testDL");
    CommandProcessorResponse resp = driver.run("create table testDL (a int) as select * from tbl2");
    assertEquals(10, resp.getResponseCode());
    assertTrue(resp.getErrorMessage().contains("CTAS not supported."));

    resp = driver.run("create table testDL (a int)");
    assertEquals(0, resp.getResponseCode());
View Full Code Here

    driver.run("drop table testDL");
    CommandProcessorResponse resp = driver.run("create table testDL (a int) as select * from tbl2");
    assertEquals(10, resp.getResponseCode());
    assertTrue(resp.getErrorMessage().contains("CTAS not supported."));

    resp = driver.run("create table testDL (a int)");
    assertEquals(0, resp.getResponseCode());
    assertNull(resp.getErrorMessage());

    Map<String,String> params = Hive.get(conf).getTable(MetaStoreUtils.DEFAULT_DATABASE_NAME, "testDL").getParameters();

View Full Code Here

    Map<String,String> params = Hive.get(conf).getTable(MetaStoreUtils.DEFAULT_DATABASE_NAME, "testDL").getParameters();

    assertEquals(DummyCreateTableHook.class.getName(),params.get("createdBy"));
    assertEquals("Open Source rocks!!", params.get("Message"));

    driver.run("drop table testDL");
  }
}
View Full Code Here

            if (ss.getIsVerbose()) {
              out.println(cmd);
            }

            qp.setTryCount(tryCount);
            ret = qp.run(cmd).getResponseCode();
            if (ret != 0) {
              qp.close();
              return ret;
            }
View Full Code Here

    SessionState.start(hiveConf);
   
    boolean tblCreated = false;
    try {
      int ecode = 0;
      ecode = drv.run(createSymlinkTableCmd).getResponseCode();
      if (ecode != 0) {
        throw new Exception("Create table command: " + createSymlinkTableCmd
            + " failed with exit code= " + ecode);
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.