Package org.apache.hadoop.hive.ql

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


    Driver driver = createDriver();
    int ret = driver.run("create table t1(id1 int, name1 string)").getResponseCode();
    Assert.assertEquals("Checking command success", 0, ret);
    ret = driver.run("create table t2(id2 int, id1 int, name2 string)").getResponseCode();
    Assert.assertEquals("Checking command success", 0, ret);
    ret = driver.run("create view v1 as select * from t1").getResponseCode();
    Assert.assertEquals("Checking command success", 0, ret);
  }

  @AfterClass
  public static void Teardown() throws Exception {
View Full Code Here


  }

  @AfterClass
  public static void Teardown() throws Exception {
    Driver driver = createDriver();
    driver.run("drop table t1");
    driver.run("drop table t2");
    driver.run("drop view v1");
  }

  @Test
View Full Code Here

  @AfterClass
  public static void Teardown() throws Exception {
    Driver driver = createDriver();
    driver.run("drop table t1");
    driver.run("drop table t2");
    driver.run("drop view v1");
  }

  @Test
  public void testQueryTable1() throws ParseException {
View Full Code Here

  @AfterClass
  public static void Teardown() throws Exception {
    Driver driver = createDriver();
    driver.run("drop table t1");
    driver.run("drop table t2");
    driver.run("drop view v1");
  }

  @Test
  public void testQueryTable1() throws ParseException {
    String query = "select * from t1";
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

      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

    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

      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

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.