Examples of bindTo()


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

       
        try{
            InputStream is = FileLocalizer.openDFSFile(quantilesFile,ConfigurationUtil.toProperties(job));
            BinStorage loader = new BinStorage();
            DataBag quantilesList;
            loader.bindTo(quantilesFile, new BufferedPositionedInputStream(is), 0, Long.MAX_VALUE);
            Tuple t = loader.getNext();
            if(t==null) throw new RuntimeException("Empty samples file");
            // the Quantiles file has a tuple as under:
            // (numQuantiles, bag of samples)
            // numQuantiles here is the reduce parallelism
View Full Code Here

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

       
        try{
            InputStream is = FileLocalizer.openDFSFile(quantilesFile,ConfigurationUtil.toProperties(job));
            BinStorage loader = new BinStorage();
            DataBag quantilesList;
            loader.bindTo(quantilesFile, new BufferedPositionedInputStream(is), 0, Long.MAX_VALUE);
            Tuple t = loader.getNext();
            if(t!=null)
            {
                // the Quantiles file has a tuple as under:
                // (numQuantiles, bag of samples)
View Full Code Here

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

    } else {
      is = FileLocalizer.openDFSFile(keyDistFile);
    }
    BinStorage loader = new BinStorage();
    DataBag partitionList;
    loader.bindTo(keyDistFile, new BufferedPositionedInputStream(is), 0, Long.MAX_VALUE);
    Tuple t = loader.getNext();
    if(t==null) {
      throw new RuntimeException("Empty samples file");
    }
    // The keydist file is structured as (key, min, max)
View Full Code Here

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

       
        try{
            InputStream is = FileLocalizer.openDFSFile(quantilesFile,ConfigurationUtil.toProperties(job));
            BinStorage loader = new BinStorage();
            ArrayList<PigNullableWritable> quantilesList = new ArrayList<PigNullableWritable>();
            loader.bindTo(quantilesFile, new BufferedPositionedInputStream(is), 0, Long.MAX_VALUE);
            Tuple t = loader.getNext();
            if(t==null) throw new RuntimeException("Empty samples file");
            // the Quantiles file has a tuple as under:
            // (numQuantiles, bag of samples)
            // numQuantiles here is the reduce parallelism
View Full Code Here

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

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

        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

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

        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

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

        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

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

        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

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

            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
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.