adriangb commented on issue #12380:
URL: https://github.com/apache/datafusion/issues/12380#issuecomment-2336588761

   I can reproduce with:
   
   ```rust
       let values = vec![Some(true), Some(false), None, Some(true)];
       let keys = vec![0, 0, 1, 2, 1, 3, 1];
       let values_array = BooleanArray::from(values);
       let keys_array = Int8Array::from(keys);
       let array = DictionaryArray::new(
           keys_array,
           Arc::new(values_array) as Arc<dyn Array>,
       );
   
       let field = Field::new(
           "my_dict",
           DataType::Dictionary(Box::new(DataType::Int8), 
Box::new(DataType::Boolean)),
           true,
       );
       let schema = Arc::new(Schema::new(vec![field]));
   
       let batch = RecordBatch::try_new(schema, vec![Arc::new(array)]).unwrap();
   
       let ctx = SessionContext::new();
   
       ctx.register_batch("dict_batch", batch).unwrap();
   
       let df = ctx.table("dict_batch").await.unwrap();
   
       // view_all
       let expected = [
           "+---------+",
           "| my_dict |",
           "+---------+",
           "| true    |",
           "| true    |",
           "| false   |",
           "|         |",
           "| false   |",
           "| true    |",
           "| false   |",
           "+---------+",
       ];
       assert_batches_eq!(expected, &df.clone().collect().await.unwrap());
   
       // filter where is null
       let result_df = df.clone().filter(col("my_dict")).unwrap();
       let expected = [
           "+---------+",
           "| my_dict |",
           "+---------+",
           "| true    |",
           "| true    |",
           "| false   |",
           "| false   |",
           "| true    |",
           "| false   |",
           "+---------+",
       ];
       assert_batches_eq!(expected, &result_df.collect().await.unwrap()); 
   ```


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