Package org.apache.pig.data

Examples of org.apache.pig.data.Datum


  public void exec(Tuple input, DataAtom output) throws IOException {
    output.setValue(tan(input));
  }
 
  protected double tan(Tuple input) throws IOException{
    Datum temp = input.getField(0);
    double retVal;
    if(!(temp instanceof DataAtom)){
      throw new IOException("invalid input format. ");
    }
    else{
View Full Code Here


  public void exec(Tuple input, DataAtom output) throws IOException {
    output.setValue(log1p(input));
  }
 
  protected double log1p(Tuple input) throws IOException{
    Datum temp = input.getField(0);
    double retVal;
    if(!(temp instanceof DataAtom)){
      throw new IOException("invalid input format. ");
    }
    else{
View Full Code Here

  public void exec(Tuple input, DataAtom output) throws IOException {
    output.setValue(atan(input));
  }
 
  protected double atan(Tuple input) throws IOException{
    Datum temp = input.getField(0);
    double retVal;
    if(!(temp instanceof DataAtom)){
      throw new IOException("invalid input format. ");
    }
    else{
View Full Code Here

    /**
     * This is a sequence we want to do frequently to accomodate the simple eval case, i.e., cases
     * where we know that running an eval spec one item should produce one and only one item.
     */
    public Datum removeFirstAndAssertEmpty(){
        Datum d;
        if (isStale() || (d = removeFirst()) == null){
            throw new RuntimeException("Simple eval used but buffer found to be empty or stale");
        }
        if (!buf.isEmpty())
            throw new RuntimeException("Simple eval used but buffer found to have more than one datum");
View Full Code Here

            @Override
            public void add(Datum d) {
                if (checkDelimiter(d))
                    addToSuccessor(d);
               
                Datum argsValue = null;
                if (args!=null)
                    argsValue = args.simpleEval(d);
               
                if (argsValue!=null && !(argsValue instanceof Tuple))
                    throw new RuntimeException("Internal error: Non-tuple returned on evaluation of arguments.");
               
                Datum placeHolderForFuncOutput = getPlaceHolderForFuncOutput();
                try{
                    func.exec((Tuple)argsValue, placeHolderForFuncOutput);
                }catch (IOException e){
                    RuntimeException re = new RuntimeException(e);
                    re.setStackTrace(e.getStackTrace());
View Full Code Here

            if (PigInputFormat.getActiveSplit() == null) {
            } else {
                index = PigInputFormat.getActiveSplit().getIndex();
            }

            Datum groupName = key.getField(0);
            finalout.group = key;
            finalout.index = index;
           
            Tuple t = new Tuple(1 + inputCount);
            t.setField(0, groupName);
View Full Code Here

TOP

Related Classes of org.apache.pig.data.Datum

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.