Examples of DataValue


Examples of org.apache.drill.exec.ref.values.DataValue

     * Rather than use a sort on the within value, we need to make sure that this operator correctly implements the
     * reference implementation. Ordering only operates with sequential segment key values. If a segment key value
     * repeats elsewhere in the stream, this operator should bring those together. together.
     **/
    if (withinConstrained) {
      DataValue current = within.eval();
      if (!current.equals(previous)) {
        withinMarkerValue++;
      }
      values[0] = new ScalarValues.LongScalar(withinMarkerValue);
    }

View Full Code Here

Examples of org.apache.drill.exec.ref.values.DataValue

      CompoundValue v2 = records.get(index1);

      for (int i = 0; i < defs.length; i++) {
        boolean nullLast = defs[i].nullsLast;
        boolean asc = defs[i].forward;
        DataValue dv1 = v1.values[i];
        DataValue dv2 = v2.values[i];
        if (dv1 == DataValue.NULL_VALUE) {
          if (dv2 == DataValue.NULL_VALUE) {
            result = 0;
          } else {
            result = nullLast ? 1 : -1;
View Full Code Here

Examples of org.apache.drill.exec.ref.values.DataValue

            }
        }

        public boolean isCrossedWithinBoundary(RecordPointer nextRecord) {
            if (withinConstrained && nextRecord != null && !holders.isEmpty()) {
                DataValue lastWithinVal = holders.get(holders.size() - 1).getPointer().getField(withinRef);
                DataValue nextWithinVal = nextRecord.getField(withinRef);
                boolean lastIsNull = lastWithinVal == null;
                boolean nextIsNull = nextWithinVal == null;
                return lastIsNull != nextIsNull || (!nextIsNull && !nextWithinVal.equals(lastWithinVal));
            }

            return false;
        }
View Full Code Here

Examples of org.apache.drill.exec.ref.values.DataValue

    public ArrayValueIterator() {
      this(new SimpleArrayValue());
    }

    public DataValue next() {
      DataValue v = null;
      if (currentIndex < arrayValue.size()) {
        v = arrayValue.getByArrayIndex(currentIndex);
      }

      currentIndex++;
View Full Code Here

Examples of org.apache.drill.exec.ref.values.DataValue

      return outputRecord;
    }

    @Override
    public NextOutcome next() {
      DataValue v;
      if ((v = arrayValueIterator.next()) != null//if we are already iterating through a sub-array, keep going
        return mergeValue(v);
      else //otherwise, get the next record
        currentOutcome = incoming.next();
View Full Code Here

Examples of org.apache.drill.exec.ref.values.DataValue

   
    @Override
    public NumericValue eval() {
      NumericValue[] values = new NumericValue[args.length];
      for(int i =0; i < values.length; i++){
        DataValue v = args[i].eval();
        if(Types.isNumericType(v.getDataType())){
          values[i] = v.getAsNumeric();
        }
      }
      return NumericValue.add(values);
    }
View Full Code Here

Examples of org.apache.drill.exec.ref.values.DataValue

      long l = 1;
      double d = 1;
      boolean isFloating = false;
     
      for(int i =0; i < args.length; i++){
        final DataValue v = args[i].eval();
//        logger.debug("DataValue {}", v);
        if(Types.isNumericType(v.getDataType())){
          NumericValue n = v.getAsNumeric();
          NumericType nt = n.getNumericType();
//          logger.debug("Numeric Type: {}", nt);
          if(isFloating || nt == NumericType.FLOAT || nt == NumericType.DOUBLE){
            if(!isFloating){
              d = l;
View Full Code Here

Examples of org.apache.drill.exec.ref.values.DataValue

   
    public abstract boolean valid(int i);
   
    @Override
    public BooleanScalar eval() {
      DataValue a = left.eval();
      DataValue b = right.eval();
     
      if(isComparable(a, b)){
        int i = ((ComparableValue)a).compareTo(b);
        return new BooleanScalar(valid( i));
      }else{
View Full Code Here

Examples of org.apache.drill.exec.ref.values.DataValue

    this.constantsOnly = e.isOnlyConstants();
  }

  @Override
  public void addRecord() {
    DataValue dv = child.eval();
    NumericValue v = dv.getAsNumeric();
    if (integer) {
     
      switch (v.getNumericType()) {
      case DOUBLE:
      case FLOAT:
View Full Code Here

Examples of org.apache.drill.exec.ref.values.DataValue

    }
  }

  @Override
  public DataValue eval() {
    DataValue v;
    if (integer) {
      v = new ScalarValues.LongScalar(l);
    } else {
      v = new ScalarValues.DoubleScalar(d);
    }
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.