Skip to content

Commit

Permalink
reproduction of a join on a struct failing at execution.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackson Newhouse committed Feb 16, 2024
1 parent e58446b commit f26d865
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions datafusion/core/tests/user_defined/user_defined_aggregates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,20 @@ async fn test_udaf_returning_struct() {
assert_batches_eq!(expected, &execute(&ctx, sql).await.unwrap());
}

#[tokio::test]
async fn test_struct_join() {
let TestContext { ctx, test_state: _ } = TestContext::new();
let sql = "SElECT l.result as result FROM (SELECT first(value, time) as result from t) as l JOIN (SELECT first(value, time) as result from t) as r ON l.result = r.result";
let expected = [
"+------------------------------------------------+",
"| result |",
"+------------------------------------------------+",
"| {value: 2.0, time: 1970-01-01T00:00:00.000002} |",
"+------------------------------------------------+",
];
assert_batches_eq!(expected, &execute(&ctx, sql).await.unwrap());
}

/// Demonstrate extracting the fields from a structure using a subquery
#[tokio::test]
async fn test_udaf_returning_struct_subquery() {
Expand Down

0 comments on commit f26d865

Please sign in to comment.