Package org.apache.pig.builtin

Examples of org.apache.pig.builtin.PigStorage.bindTo()


  private PigStorage getStore(String fieldValue) throws IOException {
    PigStorage store = storeMap.get(fieldValue);
    if (store == null) {
      store = new PigStorage(fieldDel);
      OutputStream os = createOutputStream(fieldValue);
      store.bindTo(os);
      outStreamList.add(os);
      storeMap.put(fieldValue, store);
    }
    return store;
  }
View Full Code Here


        pigServer.deleteFile(output);
        pigServer.store("OP", output, PigStorage.class.getName() + "(',')");
       
        InputStream op = FileLocalizer.open(output, pigServer.getPigContext());
        PigStorage ps = new PigStorage(",");
        ps.bindTo("", new BufferedPositionedInputStream(op), 0, Long.MAX_VALUE);
        List<Tuple> outputs = new ArrayList<Tuple>();
        Tuple t;
        while ((t = ps.getNext()) != null) {
            outputs.add(t);
        }
View Full Code Here

        pigServer.deleteFile(output);
        pigServer.store("OP", output, PigStorage.class.getName() + "(',')");
       
        InputStream op = FileLocalizer.open(output, pigServer.getPigContext());
        PigStorage ps = new PigStorage(",");
        ps.bindTo("", new BufferedPositionedInputStream(op), 0, Long.MAX_VALUE);
        List<Tuple> outputs = new ArrayList<Tuple>();
        Tuple t;
        while ((t = ps.getNext()) != null) {
            outputs.add(t);
        }
View Full Code Here

        pigServer.store("OP", output, PigStorage.class.getName() + "(',')");
       
        InputStream op = FileLocalizer.open(output+"/bar",
                                            pigServer.getPigContext());
        PigStorage ps = new PigStorage(",");
        ps.bindTo("", new BufferedPositionedInputStream(op), 0, Long.MAX_VALUE);
        List<Tuple> outputs = new ArrayList<Tuple>();
        Tuple t;
        while ((t = ps.getNext()) != null) {
            outputs.add(t);
        }
View Full Code Here

        pigServer.store("OP", output, PigStorage.class.getName() + "(',')");
       
        InputStream op = FileLocalizer.open(output+"/foobar",
                                            pigServer.getPigContext());
        PigStorage ps = new PigStorage(",");
        ps.bindTo("", new BufferedPositionedInputStream(op), 0, Long.MAX_VALUE);
        List<Tuple> outputs = new ArrayList<Tuple>();
        Tuple t;
        while ((t = ps.getNext()) != null) {
            outputs.add(t);
        }
View Full Code Here

            PigStorage storage = new PigStorage(":");
            LocalSeekableInputStream is =
                new LocalSeekableInputStream( testFile );
            BufferedPositionedInputStream bpis =
                new BufferedPositionedInputStream( is );
            storage.bindTo(testFile.getName(), bpis, 0, testFile.length());
           
            // Skip till middle of a line
            storage.skip( (text.length() + 1 )
                    * (LOOP_COUNT/2) + text.length()/2 );
           
View Full Code Here

            LocalSeekableInputStream is =
                new LocalSeekableInputStream( testFile );
            CBZip2InputStream bzis = new CBZip2InputStream( is );
            BufferedPositionedInputStream bpis =
                new BufferedPositionedInputStream( bzis );
            storage.bindTo(testFile.getName(), bpis, 0, testFile.length());
           
            // Skip till middle of a line
            storage.skip( (text.length() + 1 )
                    * (LOOP_COUNT/2) + text.length()/2 );
           
View Full Code Here

            PigStorage storage = new PigStorage(":");
            LocalSeekableInputStream is =
                new LocalSeekableInputStream( testFile );
            BufferedPositionedInputStream bpis =
                new BufferedPositionedInputStream( is );
            storage.bindTo(testFile.getName(), bpis, 0, testFile.length());
           
            // Skip till middle of a line
            storage.skip( ( (text.length() + 1 )
                    * (LOOP_COUNT/2) ) + text.length()/2 );
           
View Full Code Here

            LocalSeekableInputStream is =
                new LocalSeekableInputStream( testFile );
            CBZip2InputStream bzis = new CBZip2InputStream( is );
            BufferedPositionedInputStream bpis =
                new BufferedPositionedInputStream( bzis );
            storage.bindTo(testFile.getName(), bpis, 0, testFile.length());
           
            // Skip till middle of a line
            storage.skip( (text.length() + 1 )
                    * (LOOP_COUNT/2) + text.length()/2 );
           
View Full Code Here

        pigServer.deleteFile(output);
        pigServer.store("OP", output, PigStorage.class.getName() + "(',')");
       
        InputStream op = FileLocalizer.open(output, pigServer.getPigContext());
        PigStorage ps = new PigStorage(",");
        ps.bindTo("", new BufferedPositionedInputStream(op), 0, Long.MAX_VALUE);
        List<Tuple> outputs = new ArrayList<Tuple>();
        Tuple t;
        while ((t = ps.getNext()) != null) {
            outputs.add(t);
        }
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.