Examples of CommandProcessorResponse


Examples of org.apache.hadoop.hive.ql.processors.CommandProcessorResponse

  public void testAddPartPass() throws IOException{

    howlDriver.run("drop table junit_sem_analysis");
    howlDriver.run("create table junit_sem_analysis (a int) partitioned by (b string) stored as RCFILE");
    CommandProcessorResponse response = howlDriver.run("alter table junit_sem_analysis add partition (b='2') location '/tmp'");
    assertEquals(0, response.getResponseCode());
    assertNull(response.getErrorMessage());
    howlDriver.run("drop table junit_sem_analysis");
  }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.processors.CommandProcessorResponse

  }

  public void testCTAS(){
    howlDriver.run("drop table junit_sem_analysis");
    query = "create table junit_sem_analysis (a int) as select * from tbl2";
    CommandProcessorResponse response = howlDriver.run(query);
    assertEquals(10, response.getResponseCode());
    assertTrue(response.getErrorMessage().contains("FAILED: Error in semantic analysis: Operation not supported. Create table as Select is not a valid operation."));
    howlDriver.run("drop table junit_sem_analysis");
  }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.processors.CommandProcessorResponse

  }

  public void testStoredAs(){
    howlDriver.run("drop table junit_sem_analysis");
    query = "create table junit_sem_analysis (a int)";
    CommandProcessorResponse response = howlDriver.run(query);
    assertEquals(10, response.getResponseCode());
    assertTrue(response.getErrorMessage().contains("FAILED: Error in semantic analysis: STORED AS specification is either incomplete or incorrect."));
    howlDriver.run("drop table junit_sem_analysis");
  }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.processors.CommandProcessorResponse

  public void testInvalidateNonStringPartition() throws IOException{

    howlDriver.run("drop table junit_sem_analysis");
    query =  "create table junit_sem_analysis (a int) partitioned by (b int)  stored as RCFILE";

    CommandProcessorResponse response = howlDriver.run(query);
    assertEquals(10,response.getResponseCode());
    assertEquals("FAILED: Error in semantic analysis: Operation not supported. Howl only supports partition columns of type string. For column: b Found type: int",
        response.getErrorMessage());

  }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.processors.CommandProcessorResponse

  public void testInvalidateSeqFileStoredAs() throws IOException{

    howlDriver.run("drop table junit_sem_analysis");
    query =  "create table junit_sem_analysis (a int) partitioned by (b string)  stored as SEQUENCEFILE";

    CommandProcessorResponse response = howlDriver.run(query);
    assertEquals(10,response.getResponseCode());
    assertEquals("FAILED: Error in semantic analysis: Operation not supported. Howl doesn't support Sequence File by default yet. You may specify it through INPUT/OUTPUT storage drivers.",
        response.getErrorMessage());

  }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.processors.CommandProcessorResponse

  public void testInvalidateTextFileStoredAs() throws IOException{

    howlDriver.run("drop table junit_sem_analysis");
    query =  "create table junit_sem_analysis (a int) partitioned by (b string)  stored as TEXTFILE";

    CommandProcessorResponse response = howlDriver.run(query);
    assertEquals(10,response.getResponseCode());
    assertEquals("FAILED: Error in semantic analysis: Operation not supported. Howl doesn't support Text File by default yet. You may specify it through INPUT/OUTPUT storage drivers.",
        response.getErrorMessage());

  }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.processors.CommandProcessorResponse

    Path tblPath = new Path(fsLoc, "/tmp/test_pig/data");
    String anyExistingFileInCurDir = "ivy.xml";
    tblPath.getFileSystem(howlConf).copyFromLocalFile(new Path(anyExistingFileInCurDir),tblPath);

    howlDriver.run("drop table junit_pigstorage");
    CommandProcessorResponse resp;
    String createTable = "create table junit_pigstorage (a string) partitioned by (b string) stored as RCFILE";

    resp = howlDriver.run(createTable);
    assertEquals(0, resp.getResponseCode());
    assertNull(resp.getErrorMessage());

    resp = howlDriver.run("alter table junit_pigstorage add partition (b='2010-10-10') location '"+new Path(fsLoc, "/tmp/test_pig")+"'");
    assertEquals(0, resp.getResponseCode());
    assertNull(resp.getErrorMessage());

    resp = howlDriver.run("alter table junit_pigstorage partition (b='2010-10-10') set fileformat inputformat '" + RCFileInputFormat.class.getName()
        +"' outputformat '"+RCFileOutputFormat.class.getName()+"' inputdriver '"+PigStorageInputDriver.class.getName()+"' outputdriver 'non-existent'");
    assertEquals(0, resp.getResponseCode());
    assertNull(resp.getErrorMessage());

    resp =  howlDriver.run("desc extended junit_pigstorage partition (b='2010-10-10')");
    assertEquals(0, resp.getResponseCode());
    assertNull(resp.getErrorMessage());

    PigServer server = new PigServer(ExecType.LOCAL, howlConf.getAllProperties());
    UDFContext.getUDFContext().setClientSystemProps();
    server.registerQuery(" a = load 'junit_pigstorage' using "+HowlLoader.class.getName()+";");
    Iterator<Tuple> itr = server.openIterator("a");
View Full Code Here

Examples of org.apache.hadoop.hive.ql.processors.CommandProcessorResponse

  public void testDelim() throws MetaException, TException, UnknownTableException, NoSuchObjectException, InvalidOperationException, IOException{

    howlDriver.run("drop table junit_pigstorage_delim");

    CommandProcessorResponse resp;
    String createTable = "create table junit_pigstorage_delim (a string) partitioned by (b string) stored as RCFILE";

    resp = howlDriver.run(createTable);

    assertEquals(0, resp.getResponseCode());
    assertNull(resp.getErrorMessage());

    resp = howlDriver.run("alter table junit_pigstorage_delim add partition (b='2010-10-10')");
    assertEquals(0, resp.getResponseCode());
    assertNull(resp.getErrorMessage());

    resp = howlDriver.run("alter table junit_pigstorage_delim partition (b='2010-10-10') set fileformat inputformat '" + RCFileInputFormat.class.getName()
        +"' outputformat '"+RCFileOutputFormat.class.getName()+"' inputdriver '"+MyPigStorageDriver.class.getName()+"' outputdriver 'non-existent'");

    Partition part = msc.getPartition(MetaStoreUtils.DEFAULT_DATABASE_NAME, "junit_pigstorage_delim", "b=2010-10-10");
View Full Code Here

Examples of org.apache.hadoop.hive.ql.processors.CommandProcessorResponse

    SQLState = null;

    int ret = compile(command);
    if (ret != 0) {
      releaseLocks(ctx.getHiveLocks());
      return new CommandProcessorResponse(ret, errorMessage, SQLState);
    }

    ret = acquireReadWriteLocks();
    if (ret != 0) {
      releaseLocks(ctx.getHiveLocks());
      return new CommandProcessorResponse(ret, errorMessage, SQLState);
    }

    ret = execute();
    if (ret != 0) {
      releaseLocks(ctx.getHiveLocks());
      return new CommandProcessorResponse(ret, errorMessage, SQLState);
    }

    releaseLocks(ctx.getHiveLocks());
    return new CommandProcessorResponse(ret);
  }
View Full Code Here

Examples of org.apache.hadoop.hive.ql.processors.CommandProcessorResponse

    }
    // reset conf vars
    ss.getConf().set(HowlConstants.HOWL_CREATE_DB_NAME, "");
    ss.getConf().set(HowlConstants.HOWL_CREATE_TBL_NAME, "");

    return new CommandProcessorResponse(ret);
  }
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.