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


##########
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:
   Let's avoid checking `is_empty` in that case. Users can configure the regex 
to include it as well.



-- 
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