tustvold commented on code in PR #4795:
URL: https://github.com/apache/arrow-rs/pull/4795#discussion_r1322108756


##########
arrow-csv/src/reader/mod.rs:
##########
@@ -827,11 +880,12 @@ fn build_decimal_array<T: DecimalType>(
     col_idx: usize,
     precision: u8,
     scale: i8,
+    null_regex: Option<&Regex>,
 ) -> Result<ArrayRef, ArrowError> {
     let mut decimal_builder = PrimitiveBuilder::<T>::with_capacity(rows.len());
     for row in rows.iter() {
         let s = row.get(col_idx);
-        if s.is_empty() {
+        if s.is_empty() || null_regex.is_some_and(|r| r.is_match(s)) {

Review Comment:
   If a null regex is provided should we also treat empty strings as nulls?
   
   Edit: BTW TIL about is_some_and, very nice :ok_hand: 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to