private static Optional<Number> getConstValue(ExprNodeConstantDesc encd) {
    if (encd.getValue() == null) {
      return Optional.empty();
    }
    String constant = encd.getValue().toString();
    PrimitiveCategory category = GenericUDAFSum.getReturnType(encd.getTypeInfo());
    if (category == null) {
      return Optional.empty();
    }
    switch (category) {
    case INT:
    case BYTE:
    case SHORT:
    case LONG:
      return Optional.ofNullable(Longs.tryParse(constant));
    case FLOAT:
    case DOUBLE:
    case DECIMAL:
      return Optional.ofNullable(Doubles.tryParse(constant));
    default:
      return Optional.empty();
    }
  }
Get column statistics expression nodes
@param conf
         - hive conf
@param parentStats
         - parent statistics
@param end
         - expression nodes
@return column statistics
ql/src/java/org/apache/hadoop/hive/ql/stats/StatsUtils.java