Skip to content

Commit

Permalink
Add test for querying predicate on dictionary (apache#3937)
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb authored and Dandandan committed Nov 5, 2022
1 parent 1a43e84 commit d4efefb
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions datafusion/core/tests/sql/predicates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,34 @@ async fn csv_in_set_test() -> Result<()> {
Ok(())
}

#[tokio::test]
#[ignore]
// https://github.com/apache/arrow-datafusion/issues/3936
async fn in_set_string_dictionaries() -> Result<()> {
let input = vec![Some("foo"), Some("bar"), None, Some("fazzz")]
.into_iter()
.collect::<DictionaryArray<Int32Type>>();

let batch = RecordBatch::try_from_iter(vec![("c1", Arc::new(input) as _)]).unwrap();

let ctx = SessionContext::new();
ctx.register_batch("test", batch)?;

let sql = "SELECT * FROM test WHERE c1 IN ('foo', 'Bar', 'fazz')";
let actual = execute_to_batches(&ctx, sql).await;
let expected = vec![
"+-------+",
"| c1 |",
"+-------+",
"| foo |",
"| fazzz |",
"+-------+",
];

assert_batches_eq!(expected, &actual);
Ok(())
}

#[tokio::test]
#[ignore]
// https://github.com/apache/arrow-datafusion/issues/3635
Expand Down

0 comments on commit d4efefb

Please sign in to comment.