Package org.apache.drill.exec.ref.values

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


        aggs[x].addRecord()
      }
     
      // if we're in target mode and this row matches the target criteria, we're going to copy carry over values and mark foundTarget = true.
      if(targetMode){
        DataValue v = targetEvaluator.eval();
        if(v.getDataType().getMinorType() == MinorType.BIT && v.getAsBooleanValue().getBoolean()){
          foundTarget = true;
          for(int i =0 ; i < carryovers.length; i++){
            carryoverValues[i] = carryovers[i].eval();
          }
        }
View Full Code Here


     * @return Whether or not the record should be included in the output.
     */
    private boolean writeOutputRecord(){
      outputRecord.clear();
      for(int x = 0; x < aggs.length; x++){
        DataValue dv = aggs[x].eval();
//        logger.debug("Adding Aggregated Values named {} with value {}", outputNames[x], dv);
        outputRecord.addField(aggNames[x], dv);
      }
     
      // Add the carryover keys.
View Full Code Here

    }
  }

  @Override
  public DataValue eval() {
    DataValue v = new ScalarValues.LongScalar(l);
    l = 0;
    return v;
  }
View Full Code Here

     * 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

      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

            }
        }

        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

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

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

      currentIndex++;
View Full Code Here

      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

   
    @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

      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

TOP

Related Classes of org.apache.drill.exec.ref.values.DataValue

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.