public static double getValueAsDouble(Row row, int index) throws IOException, NoNumberException {
    double ans = 0;
    try {
      switch (row.getDataType(index)) {
        case INT32:
          ans = row.getInt(index);
          break;
        case INT64:
          ans = row.getLong(index);
          break;
        case FLOAT:
          ans = row.getFloat(index);
          break;
        case DOUBLE:
          ans = row.getDouble(index);
          break;
        case DATE:
        case BLOB:
        case BOOLEAN:
        case STRING:
        case TEXT:
        case TIMESTAMP:
        default:
          throw new NoNumberException();
      }
    } catch (IOException e) {
      throw new IOException("Fail to get data type in row " + row.getTime(), e);
    }
    return ans;
  }
Get value from specific column from Row, and cast to double. Make sure never get null from Row.

@param row data row
@param index the column index
@return value of specific column from Row
@throws NoNumberException when getting a no number datatype
library-udf/src/main/java/org/apache/iotdb/library/util/Util.java