Package org.apache.pig

Examples of org.apache.pig.PigServer.shutdown()


    } catch (ExecException ex) {
      throw convertPigAccessException(ex);
    } catch (IOException ex) {
      throw convertPigAccessException(ex);
    } finally {
      pig.shutdown();
    }
  }

  /**
   * Converts the given Pig exception to an appropriate exception from the <tt>org.springframework.dao</tt> hierarchy.
View Full Code Here


    while (it.hasNext()) {
      Tuple cur = it.next();
      System.out.println(cur);
    }

    pigServer.shutdown();
    /*
     * Use pig STORE to store testing data
     */
    /*
     * pigServer.store("records", new Path(pathTable, "store").toString(),
View Full Code Here

    while (it.hasNext()) {
      Tuple cur = it.next();
      System.out.println(cur);
    }

    pigServer.shutdown();
    /*
     * Use pig STORE to store testing data
     */
    /*
     * pigServer.store("records", new Path(pathTable, "store").toString(),
View Full Code Here

        pig.registerQuery("b = row_count(a);");
        Iterator<Tuple> iter = pig.openIterator("b");

        assertEquals(2L, ((Long)iter.next().get(0)).longValue());

        pig.shutdown();
    }

    @Test
    public void testInlineMacro() throws Throwable {
        PigServer pig = new PigServer(ExecType.LOCAL);
View Full Code Here

        pig.registerQuery("b = row_count(a);");
        Iterator<Tuple> iter = pig.openIterator("b");

        assertEquals(2L, ((Long)iter.next().get(0)).longValue());

        pig.shutdown();
    }
   
    @Test
    public void testRegisterResourceMacro() throws Throwable {
        PigServer pig = new PigServer(ExecType.LOCAL);
View Full Code Here

        pig.registerQuery("b = row_count_in_jar(a);");
        Iterator<Tuple> iter = pig.openIterator("b");
       
        assertTrue(((Long)iter.next().get(0))==5);

        pig.shutdown();
    }
}
View Full Code Here

      Assert.assertEquals("Expected '1' rows; got '" + l.size() + "'", 1, l.size());
      int result = Integer.parseInt((String)l.get(0));
      Assert.assertEquals("Expected value '41'; got '" + result + "'", 41, result);
    }
    finally {
      server.shutdown();
    }
  }
  /**
   * Ensure Pig can read/write tinyint/smallint columns.
   */
 
View Full Code Here

                "store f into 'out';";
        PigServer pigServer = new PigServer(cluster.getExecType(), properties);
        PigContext pc = pigServer.getPigContext();
        assertTrue((Util.buildMRPlan(Util.buildPp(pigServer, query), pc).getRoots().get(0).combinePlan
                .isEmpty()));
        pigServer.shutdown();
    }

    @Test
    public void testSuccessiveUserFuncs2() throws Exception {
        String dummyUDF = JiraPig1030.class.getName();
View Full Code Here

                "store f into 'out';";
        PigServer pigServer = new PigServer(cluster.getExecType(), properties);
        PigContext pc = pigServer.getPigContext();
        assertTrue((Util.buildMRPlan(Util.buildPp(pigServer, query), pc).getRoots().get(0).combinePlan
                .isEmpty()));
        pigServer.shutdown();
    }

    @Test
    public void testOnCluster() throws Exception {
        // run the test on cluster
View Full Code Here

    public void testOnCluster() throws Exception {
        // run the test on cluster
        PigServer pigServer = new PigServer(cluster.getExecType(), properties);
        String inputFileName = runTest(pigServer);
        Util.deleteFile(cluster, inputFileName);
        pigServer.shutdown();
    }

    @Test
    public void testLocal() throws Exception {
        // run the test locally
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.