private void checkQuery(String expRes,String qry) throws Exception {
  assertEquals(0,executeHiveQuery("drop table if exists result"));
  assertEquals(0,executeHiveQuery("create table result " + "row format delimited fields terminated by ' ' " + "stored as textfile "+ "location '/result' as "+ qry));
  IgfsInputStream in=igfs.open(new IgfsPath("/result/000000_0"));
  byte[] buf=new byte[(int)in.length()];
  in.read(buf);
  assertEquals(expRes,new String(buf));
}

private void checkQuery ( String expRes , String qry ) throws Exception { assertEquals ( 0 , executeHiveQuery ( "drop table if exists result" ) ) ; assertEquals ( 0 , executeHiveQuery ( "create table result " + "row format delimited fields terminated by ' ' " + "stored as textfile " + "location '/result' as " + qry ) ) ; IgfsInputStream in = igfs . open ( new IgfsPath ( "/result/000000_0" ) ) ; byte [ ] buf = new byte [ ( int ) in . length ( ) ] ; in . read ( buf ) ; assertEquals ( expRes , new String ( buf ) ) ; }
runs query check result .
