66OJ66 opened a new issue, #7797:
URL: https://github.com/apache/arrow-datafusion/issues/7797

   ### Describe the bug
   
   Initial discussion here: 
https://github.com/apache/arrow-datafusion/discussions/7761
   
   In short, it seems like empty strings in CSV files aren't being interpreted 
as null 
   
   ### To Reproduce
   
   Create a simple `.csv` file this this:
   ```
   id,name
   1,
   2,bob
   ```
   
   Run the following code:
   ```rust
   #[tokio::main]
   async fn main() -> Result<(), DataFusionError> {
       let ctx = SessionContext::new();
   
       let results = ctx
           .read_csv("input.csv", CsvReadOptions::new())
           .await?
           .filter(IsNotNull(Box::new(col("name"))))?
           .collect()
           .await?;
   
       let pretty_results = 
arrow::util::pretty::pretty_format_batches(&results)?.to_string();
   
       println!("{}", pretty_results);
   
       Ok(())
   }
   ```
   
   ### Expected behavior
   
   I was expecting the output to look like this:
   ```
   +----+------+
   | id | name |
   +----+------+
   | 2  | bob  |
   +----+------+
   ```
   
   But the full dataset is returned instead:
   ```
   +----+------+
   | id | name |
   +----+------+
   | 1  |      |
   | 2  | bob  |
   +----+------+
   ```
   
   ### Additional context
   
   I've tested this on main and `datafusion` v31.0.0 and the result is the same


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