message: Convert invalid float/double values into nulls
diff: @@ -312,6 +312,21 @@ ParquetReader::~ParquetReader() {
  ParquetReaderColumnData::~ParquetReaderColumnData() {
  }
  +struct ValueIsValid {
  + template<class T>
  + static bool Operation(T value) {
  + return true;
  + }
  +};
  +
  +template<> bool ValueIsValid::Operation(float value) {
  + return Value::FloatIsValid(value);
  +}
  +
  +template<> bool ValueIsValid::Operation(double value) {
  + return Value::DoubleIsValid(value);
  +}
  +
  template <class T>
  void ParquetReader::fill_from_dict(ParquetReaderColumnData &col_data, idx_t count, Vector &target,
  idx_t target_offset) {
  @@ -323,7 +338,12 @@ void ParquetReader::fill_from_dict(ParquetReaderColumnData &col_data, idx_t coun
  to_string(col_data.dict_size) + " at " + to_string(i + target_offset) +
  ". Corrupt file?");
  }
  - ((T *)FlatVector::GetData(target))[i + target_offset] = ((const T *)col_data.dict.ptr)[offset];
  + auto value = ((const T *)col_data.dict.ptr)[offset];
  + if (ValueIsValid::Operation(value)) {
  + ((T *)FlatVector::GetData(target))[i + target_offset] = value;
  + } else {
  + FlatVector::SetNull(target, i + target_offset, true);
  + }
  } else {
  FlatVector::SetNull(target, i + target_offset, true);
  }
  @@ -335,7 +355,12 @@ void ParquetReader::fill_from_plain(ParquetReaderColumnData &col_data, idx_t cou
  idx_t target_offset) {
  for (idx_t i = 0; i < count; i++) {
  if (!col_data.has_nulls || col_data.defined_buf.ptr[i]) {
  - ((T *)FlatVector::GetData(target))[i + target_offset] = col_data.payload.read<T>();
  + auto value = col_data.payload.read<T>();
  + if (ValueIsValid::Operation(value)) {
  + ((T *)FlatVector::GetData(target))[i + target_offset] = value;
  + } else {
  + FlatVector::SetNull(target, i + target_offset, true);
  + }
  } else {
  FlatVector::SetNull(target, i + target_offset, true);
  }
  