Package org.apache.pig.data

Examples of org.apache.pig.data.Datum


    @Override
    public boolean eval(Datum input){
        try {
           
            Datum d = null;
            if (args!=null)
                d = args.simpleEval(input);
           
            if (d!=null && !(d instanceof Tuple))
                throw new RuntimeException("Internal error: Non-tuple returned on evaluation of arguments.");
View Full Code Here


  public void exec(Tuple input, DataAtom output) throws IOException {
    output.setValue(asin(input));
  }
 
  protected double asin(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

    }

    @Override
    public boolean eval(Datum input){
       
        Datum d = left.simpleEval(input);
       
        if (!(d instanceof DataAtom))
            throw new RuntimeException("Cannot match non-atomic value against a regular expression. Use a filter function instead.");

        return ((DataAtom)d).strval().matches(re);
View Full Code Here

  public void exec(Tuple input, DataAtom output) throws IOException {
    output.setValue(sin(input));
  }
 
  protected double sin(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

    output.setValue(abs(input));
  }
 

  protected double abs(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(tanh(input));
  }
 
  protected double tanh(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 class OrdDescNumeric extends ComparisonFunc {
    public int compare(Tuple t1, Tuple t2) {
        try {
            for (int i = 0; i < t1.arity(); i++) {
                Datum d1 = t1.getField(i);
                Datum d2 = t2.getField(i);
                int comp;
                if (d1 instanceof DataAtom) {
                    comp = compare((DataAtom)d1, (DataAtom)d2);
                } else {
                    comp = compare((Tuple)d1, (Tuple)d2);
View Full Code Here

  public void exec(Tuple input, DataAtom output) throws IOException {
    output.setValue(exp(input));
  }
 
  protected double exp(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(floor(input));
  }
 
  protected double floor(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(acos(input));
  }
 
  protected double acos(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

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.