Exemplo n.º 1
0
 @Test
 public void testErrorMessageUndefinedAliasInGroupByStatement() throws Exception {
   String queryA = "A = load 'nosuchfile'  using PigStorage() as (f1:chararray,f2:chararray);";
   String queryB = "B = GROUP B by f1;";
   PigServer ps = new PigServer(ExecType.LOCAL);
   ps.registerQuery(queryA);
   try {
     ps.registerQuery(queryB);
   } catch (FrontendException e) {
     Assert.assertTrue(e.getMessage().contains("Undefined alias:"));
     return;
   }
   Assert.fail();
 }
Exemplo n.º 2
0
 @Test
 public void testSplitWithNotEvalCondition() throws Exception {
   String defineQ =
       "define minelogs org.apache.pig.test.RegexGroupCount('www\\\\.xyz\\\\.com/sports');";
   String defineL = "a = load 'nosuchfile' " + " using PigStorage() as (source : chararray);";
   String defineSplit =
       "SPLIT a INTO a1 IF (minelogs(source) > 0 ), a2 IF (NOT (minelogs(source)>0));"; //    (NOT
                                                                                        // (
                                                                                        // minelogs(source) ) > 0) ;";
   PigServer ps = new PigServer(ExecType.LOCAL);
   ps.registerQuery(defineQ);
   ps.registerQuery(defineL);
   try {
     ps.registerQuery(defineSplit);
   } catch (FrontendException e) {
     Assert.fail(e.getMessage());
   }
 }