Package org.apache.tajo.datum

Examples of org.apache.tajo.datum.Datum.asInt4()


    if(datum instanceof NullDatum) return NullDatum.get();

    Datum countDatum = params.get(1);
    if(countDatum instanceof NullDatum) return NullDatum.get();

    return DatumFactory.createText(repeat(datum.asChars(), countDatum.asInt4()));
  }
}
View Full Code Here


  public void merge(FunctionContext context, Tuple params) {
    SumContext distinctContext = (SumContext) context;
    Datum value = params.get(0);
    if ((distinctContext.latest == null || (!distinctContext.latest.equals(value)) && !(value instanceof NullDatum))) {
      distinctContext.latest = value;
      distinctContext.sum += value.asInt4();
    }
  }

  @Override
  public Datum getPartialResult(FunctionContext ctx) {
View Full Code Here

    Datum valueDatum = params.get(0);
    if(valueDatum instanceof NullDatum) {
      return NullDatum.get();
    }

    return DatumFactory.createInt4(Math.abs(valueDatum.asInt4()));
  }
}
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.