Package org.apache.hadoop.hive.common.type

Examples of org.apache.hadoop.hive.common.type.Decimal128.update()


    Decimal128 d = new Decimal128();
    int scale = HiveDecimalUtils.getScaleForType(ptinfo);
    switch (ptinfo.getPrimitiveCategory()) {
      case FLOAT:
        float floatVal = ((Float) scalar).floatValue();
        d.update(floatVal, (short) scale);
        break;
      case DOUBLE:
        double doubleVal = ((Double) scalar).doubleValue();
        d.update(doubleVal, (short) scale);
        break;
View Full Code Here


        float floatVal = ((Float) scalar).floatValue();
        d.update(floatVal, (short) scale);
        break;
      case DOUBLE:
        double doubleVal = ((Double) scalar).doubleValue();
        d.update(doubleVal, (short) scale);
        break;
      case BYTE:
        byte byteVal = ((Byte) scalar).byteValue();
        d.update(byteVal, (short) scale);
        break;
View Full Code Here

        double doubleVal = ((Double) scalar).doubleValue();
        d.update(doubleVal, (short) scale);
        break;
      case BYTE:
        byte byteVal = ((Byte) scalar).byteValue();
        d.update(byteVal, (short) scale);
        break;
      case SHORT:
        short shortVal = ((Short) scalar).shortValue();
        d.update(shortVal, (short) scale);
        break;
View Full Code Here

        byte byteVal = ((Byte) scalar).byteValue();
        d.update(byteVal, (short) scale);
        break;
      case SHORT:
        short shortVal = ((Short) scalar).shortValue();
        d.update(shortVal, (short) scale);
        break;
      case INT:
        int intVal = ((Integer) scalar).intValue();
        d.update(intVal, (short) scale);
        break;
View Full Code Here

        short shortVal = ((Short) scalar).shortValue();
        d.update(shortVal, (short) scale);
        break;
      case INT:
        int intVal = ((Integer) scalar).intValue();
        d.update(intVal, (short) scale);
        break;
      case LONG:
        long longVal = ((Long) scalar).longValue();
        d.update(longVal, (short) scale);
        break;
View Full Code Here

        int intVal = ((Integer) scalar).intValue();
        d.update(intVal, (short) scale);
        break;
      case LONG:
        long longVal = ((Long) scalar).longValue();
        d.update(longVal, (short) scale);
        break;
      case DECIMAL:
        HiveDecimal decimalVal = (HiveDecimal) scalar;
        d.update(decimalVal.unscaledValue(), (short) scale);
        break;
View Full Code Here

        long longVal = ((Long) scalar).longValue();
        d.update(longVal, (short) scale);
        break;
      case DECIMAL:
        HiveDecimal decimalVal = (HiveDecimal) scalar;
        d.update(decimalVal.unscaledValue(), (short) scale);
        break;
      default:
        throw new HiveException("Unsupported type "+typename+" for cast to Decimal128");
    }
    return d;
View Full Code Here

        return 0;
      }
    } else if (decimalTypePattern.matcher(constDesc.getTypeString()).matches()) {
      HiveDecimal hd = (HiveDecimal) constDesc.getValue();
      Decimal128 dvalue = new Decimal128();
      dvalue.update(hd.unscaledValue(), (short) hd.scale());
      return dvalue;
    } else {
      return constDesc.getValue();
    }
  }
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.