Package org.apache.hadoop.hive.ql

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


      sb.append("ALTER INDEX ");
      sb.append(idx.getIndexName());
      sb.append(" ON ");
      sb.append(idx.getOrigTableName());
      sb.append(" REBUILD");
      driver.compile(sb.toString(), false);
      tasks.addAll(driver.getPlan().getRootTasks());
      inputs.addAll(driver.getPlan().getInputs());
    }
  }
View Full Code Here


    sb.append(index.getOrigTableName());
    sb.append(" PARTITION ");
    sb.append(ps.toString());
    sb.append(" REBUILD");
    Driver driver = new Driver(this.conf);
    driver.compile(sb.toString(), false);
    tasks.addAll(driver.getPlan().getRootTasks());
    inputs.addAll(driver.getPlan().getInputs());
  }

View Full Code Here

  @Test
  public void testDecimalType3() throws ParseException {
    String query = "create table dec (d decimal(66,7))";

    Driver driver = createDriver();
    int rc = driver.compile(query);
    Assert.assertTrue("Got " + rc + ", expected not zero", rc != 0);
    Assert.assertTrue(driver.getErrorMsg(),
        driver.getErrorMsg().contains("Decimal precision out of allowed range [1,38]"));
  }
View Full Code Here

  @Test
  public void testDecimalType4() throws ParseException {
    String query = "create table dec (d decimal(0,7))";

    Driver driver = createDriver();
    int rc = driver.compile(query);
    Assert.assertTrue("Got " + rc + ", expected not zero", rc != 0);
    Assert.assertTrue(driver.getErrorMsg(),
        driver.getErrorMsg().contains("Decimal precision out of allowed range [1,38]"));
  }
View Full Code Here

  @Test
  public void testDecimalType5() throws ParseException {
    String query = "create table dec (d decimal(7,33))";

    Driver driver = createDriver();
    int rc = driver.compile(query);
    Assert.assertTrue("Got " + rc + ", expected not zero", rc != 0);
    Assert.assertTrue(driver.getErrorMsg(),
        driver.getErrorMsg().contains("Decimal scale must be less than or equal to precision"));
  }
View Full Code Here

  @Test
  public void testDecimalType6() throws ParseException {
    String query = "create table dec (d decimal(7,-1))";

    Driver driver = createDriver();
    int rc = driver.compile(query);
    Assert.assertTrue("Got " + rc + ", expected not zero", rc != 0);
    Assert.assertTrue(driver.getErrorMsg(),
        driver.getErrorMsg().contains("extraneous input '-' expecting Number"));
  }
View Full Code Here

  @Test
  public void testDecimalType7() throws ParseException {
    String query = "create table dec (d decimal(7,33,4))";

    Driver driver = createDriver();
    int rc = driver.compile(query);
    Assert.assertTrue("Got " + rc + ", expected not zero", rc != 0);
    Assert.assertTrue(driver.getErrorMsg(),
        driver.getErrorMsg().contains("missing ) at ',' near ',' in column specification"));
  }
View Full Code Here

  @Test
  public void testDecimalType8() throws ParseException {
    String query = "create table dec (d decimal(7a))";

    Driver driver = createDriver();
    int rc = driver.compile(query);
    Assert.assertTrue("Got " + rc + ", expected not zero", rc != 0);
    Assert.assertTrue(driver.getErrorMsg(),
        driver.getErrorMsg().contains("mismatched input '7a' expecting Number near '('"));
  }
View Full Code Here

  @Test
  public void testDecimalType9() throws ParseException {
    String query = "create table dec (d decimal(20,23))";

    Driver driver = createDriver();
    int rc = driver.compile(query);
    Assert.assertTrue("Got " + rc + ", expected not zero", rc != 0);
    Assert.assertTrue(driver.getErrorMsg(),
        driver.getErrorMsg().contains("Decimal scale must be less than or equal to precision"));
  }
View Full Code Here

   * @throws ParseException
   */
  @Test
  public void testSelectEntityDirect() throws ParseException {
    Driver driver = createDriver();
    int ret = driver.compile("select * from t1");
    assertEquals("Checking command success", 0, ret);
    assertEquals(1, CheckInputReadEntityDirect.readEntities.size());
    assertTrue("isDirect", CheckInputReadEntityDirect.readEntities.iterator().next().isDirect());
  }

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.