Examples of registerFunction()


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

      PrintWriter writer = new PrintWriter(tempFile);
      writer.println("foo");
      writer.println("boo");
      writer.close();
     
      pig.registerFunction("myTr",ShellBagEvalFunc.class.getName() + "('tr o 0')");
      pig.registerQuery("a = load 'file:" + Util.encodeEscape(tempFile.toString()) + "';");
      pig.registerQuery("b = foreach a generate myTr(*);");
      Iterator<Tuple> iter = pig.openIterator("b");
           
      Tuple t;
View Full Code Here

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

      for (int i=0; i< numTimes; i++){
        writer.println(i+"oo");
      }
      writer.close();
     
      pig.registerFunction("tr1",ShellBagEvalFunc.class.getName() + "('tr o A')");
      pig.registerFunction("tr2",ShellBagEvalFunc.class.getName() + "('tr o B')");
      pig.registerQuery("a = load 'file:" + Util.encodeEscape(tempFile.toString()) + "';");
      pig.registerQuery("b = foreach a generate tr1(*),tr2(*);");
      Iterator<Tuple> iter = pig.openIterator("b");
     
View Full Code Here

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

        writer.println(i+"oo");
      }
      writer.close();
     
      pig.registerFunction("tr1",ShellBagEvalFunc.class.getName() + "('tr o A')");
      pig.registerFunction("tr2",ShellBagEvalFunc.class.getName() + "('tr o B')");
      pig.registerQuery("a = load 'file:" + Util.encodeEscape(tempFile.toString()) + "';");
      pig.registerQuery("b = foreach a generate tr1(*),tr2(*);");
      Iterator<Tuple> iter = pig.openIterator("b");
     
      for (int i=0; i< numTimes; i++){
View Full Code Here

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

        try {
            pig = new PigServer("local");
        } catch (IOException e) {
            assertTrue(false)// pig server failed for some reason
        }
      pig.registerFunction("myTr",ShellBagEvalFunc.class.getName() + "('tr o 0')");
    try{
      pig.registerQuery("b = foreach (load 'a') generate myTr(myTr(*));");
        }catch(Exception e){
          return;
        }
View Full Code Here

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

        try {
            pig = new PigServer("local");
        } catch (IOException e) {
            assertTrue(false)// pig server failed for some reason
        }
        pig.registerFunction("myTr",
            new FuncSpec(GFAny.class.getName() + "('tr o 0')"));
        try{
            pig.registerQuery("b = foreach (load 'a') generate myTr(myTr(*));");
        }catch(Exception e){
            return;
View Full Code Here

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

        try {
            pig = new PigServer("local");
        } catch (IOException e) {
            assertTrue(false)// pig server failed for some reason
        }
        pig.registerFunction("myTr",
            new FuncSpec(GFAny.class.getName() + "('tr o 0')"));
        try{
            pig.registerQuery("b = foreach (load 'a') generate myTr(myTr(*));");
        }catch(Exception e){
            return;
View Full Code Here

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

        String singlePartitionedFile = simpleDataFile.getAbsolutePath();

        PigServer server = new PigServer(ExecType.LOCAL);
        server.setBatchOn();
        server.registerFunction("org.apache.pig.piggybank.storage.HiveColumnarLoader",
                new FuncSpec(funcSpecString));

        server.registerQuery("a = LOAD '" + Util.encodeEscape(singlePartitionedFile) + "' using " + funcSpecString
                + ";");
View Full Code Here

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

        String singlePartitionedDir = simpleDataDir.getAbsolutePath();

        PigServer server = new PigServer(ExecType.LOCAL);
        server.setBatchOn();
        server.registerFunction("org.apache.pig.piggybank.storage.HiveColumnarLoader",
                new FuncSpec(funcSpecString));

        server.registerQuery("a = LOAD '" + Util.encodeEscape(singlePartitionedDir) + "' using " + funcSpecString
                + ";");
View Full Code Here

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

        String singlePartitionedFile = simpleDataFile.getAbsolutePath();

        PigServer server = new PigServer(ExecType.LOCAL);
        server.setBatchOn();
        server.registerFunction("org.apache.pig.piggybank.storage.HiveColumnarLoader",
                new FuncSpec(funcSpecString));

        server.registerQuery("a = LOAD '" + Util.encodeEscape(singlePartitionedFile) + "' using " + funcSpecString
                + ";");
View Full Code Here

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

        String funcSpecString = "org.apache.pig.piggybank.storage.HiveColumnarLoader('f1 string,f2 string,f3 string')";

        PigServer server = new PigServer(ExecType.LOCAL);
        server.setBatchOn();
        server.registerFunction("org.apache.pig.piggybank.storage.HiveColumnarLoader",
                new FuncSpec(funcSpecString));

        server.registerQuery("a = LOAD '" + Util.encodeEscape(yearMonthDayHourPartitionedDir.getAbsolutePath())
                + "' using " + funcSpecString + ";");
        server.registerQuery("f = FILTER a by year=='2010';");
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.