Package org.apache.hadoop.hive.ql

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


      tblCreated = true;
      String loadFileCommand = "LOAD DATA LOCAL INPATH '" +
        new Path(symlinkDir, "symlink_file").toString() + "' INTO TABLE " + tblName;

      ecode = drv.run(loadFileCommand).getResponseCode();
      if (ecode != 0) {
        throw new Exception("Load data command: " + loadFileCommand
            + " failed with exit code= " + ecode);
      }
View Full Code Here


    } catch (Exception e) {
      e.printStackTrace();
      fail("Caught exception " + e);
    } finally {
      if (tblCreated) {
        drv.run("drop table text_symlink_text").getResponseCode();
      }
    }
  }

  /**
 
View Full Code Here

public class TestReadEntityDirect {

  @BeforeClass
  public static void onetimeSetup() throws CommandNeedRetryException {
    Driver driver = createDriver();
    int ret = driver.run("create table t1(i int)").getResponseCode();
    assertEquals("Checking command success", 0, ret);
    ret = driver.run("create view v1 as select * from t1").getResponseCode();
    assertEquals("Checking command success", 0, ret);
  }

View Full Code Here

  @BeforeClass
  public static void onetimeSetup() throws CommandNeedRetryException {
    Driver driver = createDriver();
    int ret = driver.run("create table t1(i int)").getResponseCode();
    assertEquals("Checking command success", 0, ret);
    ret = driver.run("create view v1 as select * from t1").getResponseCode();
    assertEquals("Checking command success", 0, ret);
  }

  @Before
  public void setup() {
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

      CommandProcessor proc = CommandProcessorFactory.get(tokens[0]);
      if (proc != null) {
        if (proc instanceof Driver) {
          Driver qp = (Driver) proc;
          queryRet.add(new Integer(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 localSession = null;
      if(SessionState.get() == null) {
         localSession = SessionState.start(new SessionState(conf));
      }
      try {
        CommandProcessorResponse cpr = d.run(sb.toString());
        if (cpr.getResponseCode() != 0) {
          throw new IOException("Could not update stats for table " + ci.getFullTableName() +
            (ci.partName == null ? "" : "/" + ci.partName) + " due to: " + cpr);
        }
      }
View Full Code Here

      SessionState.start(ss);

      String cmd = "select a.key+1 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

            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

    Driver proc = mock(Driver.class);

    CommandProcessorResponse cpr = mock(CommandProcessorResponse.class);
    when(cpr.getResponseCode()).thenReturn(0);
    when(proc.run(anyString())).thenReturn(cpr);

    // and then see what happens based on the provided schema
    when(proc.getSchema()).thenReturn(mockSchema);

    CliSessionState mockSS = mock(CliSessionState.class);
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.