Package org.apache.pig.impl.builtin

Examples of org.apache.pig.impl.builtin.PoissonSampleLoader


     
      ArrayList<Pair<FileSpec, Boolean>> inputs = new ArrayList<Pair<FileSpec, Boolean> >();
      inputs.add(new Pair<FileSpec, Boolean>(fs, true));
     
        // Use 100 as a default value;
        PoissonSampleLoader ps = new PoissonSampleLoader((new FuncSpec(PigStorage.class.getName())).toString(), "100");

        // Get the number of samples for the file
        ps.computeSamples(inputs, pigServer.getPigContext());
       
        if (ps.getNumSamples() != 3) {
          fail("Compute samples returned the wrong number of samples");
        }
    }
View Full Code Here


      inputs.add(new Pair<FileSpec, Boolean>(fs, true));
      Properties p = UDFContext.getUDFContext().getUDFProperties(SampleLoader.class);
      p.setProperty("pig.input.0.size", Long.toString(Util.getSize(cluster, INPUT_FILE1)));
     
        // Use 100 as a default value;
        PoissonSampleLoader ps = new PoissonSampleLoader((new FuncSpec(PigStorage.class.getName())).toString(), "100");

        // Get the number of samples for the file
        ps.computeSamples(inputs, pigServer.getPigContext());
       
        if (ps.getNumSamples() != 3) {
          fail("Compute samples returned the wrong number of samples: " + ps.getNumSamples() + " instead of 3");
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.pig.impl.builtin.PoissonSampleLoader

Copyright © 2018 www.massapicom. 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.