You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "comphead (via GitHub)" <gi...@apache.org> on 2023/03/06 18:00:39 UTC

[GitHub] [arrow-datafusion] comphead commented on issue #5470: Joins on type FixedSizeBinary(16) returning incorrect results

comphead commented on issue #5470:
URL: https://github.com/apache/arrow-datafusion/issues/5470#issuecomment-1456658617

   @maxburke please consider the same local test
   
   ```
   #[tokio::test]
   async fn test_join_binary() -> Result<()> {
       let t1 = Arc::new(Schema::new(vec![
           Field::new("a", DataType::FixedSizeBinary(16), true),
       ]));
       let t2 = Arc::new(Schema::new(vec![
           Field::new("a", DataType::Int64, true),
       ]));
       let batch1 = RecordBatch::try_new(
           t1,
           vec![
               Arc::new(FixedSizeBinaryArray::from(vec![Some("1111111111111111".as_bytes()), Some("1111111111111112".as_bytes()), None])),
           ],
       )?;
       let batch2 = RecordBatch::try_new(
           t2,
           vec![
               Arc::new(Int64Array::from(vec![None, Some(1111111111111111_i64), Some(1111111111111112_i64)])),
           ],
       )?;
   
       let ctx = SessionContext::new();
   
       ctx.register_batch("t1", batch1)?;
       ctx.register_batch("t2", batch2)?;
   
       let df = ctx.sql("select * from t1 inner join t1 as t2 on t1.a = t2.a").await?;
   
       let results = df.collect().await?;
       println!("{:?}", &results);
       Ok(())
   }
   ```
   
   No dups


-- 
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-unsubscribe@arrow.apache.org

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