alamb commented on issue #13510:
URL: https://github.com/apache/datafusion/issues/13510#issuecomment-2627761615

   Here is a self contained reproducer
   
   I think this only affects `DataFrame` with unnamed relations (if the inputs 
have names things are ok)
   
   I suspect this coercion issue has always been lurking, but it became more of 
an issue once `Utf8View` became more common
   
   
   ```rust
   #[tokio::test]
   async fn join_coercion_unnnamed() -> Result<()> {
       let ctx = SessionContext::new();
   
       // Test that join will coerce column types when necessary
       // even when the relations don't have unique names
       let left = ctx.read_batch(record_batch!(
           ("id", Int32, [1, 2, 3]),
           ("name", Utf8, ["a", "b", "c"])
       )?)?;
       let right = ctx.read_batch(record_batch!(
           ("id", Int32, [10, 3]),
           ("name", Utf8View, ["d", "c"]) // Utf8View is a different type
       )?)?;
       let cols = vec!["name", "id"];
   
       let filter = None;
       let join = right.join(left, JoinType::LeftAnti, &cols, &cols, filter)?;
       let results = join.collect().await?;
   
       assert_batches_sorted_eq!(
           [
               "+----+----+",
               "| id | id |",
               "+----+----+",
               "| c  | c  |",
               "+----+----+",
           ],
           &results
       );
       Ok(())
   }
   
   ```


-- 
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: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to