public DoubleWritable evaluate(Text i) {
    if (i == null) {
      return null;
    } else {
      if (!LazyUtils.isNumberMaybe(i.getBytes(), 0, i.getLength())) {
        return null;
      }
      try {
        doubleWritable.set(Double.parseDouble(i.toString()));
        return doubleWritable;
      } catch (NumberFormatException e) {
        // MySQL returns 0 if the string is not a well-formed double value.
        // But we decided to return NULL instead, which is more conservative.
        return null;
      }
    }
  }
Convert from string to a double. This is called for CAST(... AS DOUBLE)

@param i
         The string value to convert
@return DoubleWritable
ql/src/java/org/apache/hadoop/hive/ql/udf/UDFToDouble.java