andygrove commented on code in PR #2402:
URL: https://github.com/apache/arrow-datafusion/pull/2402#discussion_r862913296
##########
datafusion/core/tests/sql/expr.rs:
##########
@@ -1127,3 +1129,25 @@ async fn csv_query_sqrt_sqrt() -> Result<()> {
assert_float_eq(&expected, &actual);
Ok(())
}
+
+#[tokio::test]
+async fn nested_subquery() -> Result<()> {
+ let ctx = SessionContext::new();
+ let schema = Schema::new(vec![
+ Field::new("id", DataType::Int16, false),
+ Field::new("a", DataType::Int16, false),
+ ]);
+ let empty_table = Arc::new(EmptyTable::new(Arc::new(schema)));
+ ctx.register_table("t1", empty_table.clone())?;
+ ctx.register_table("t2", empty_table)?;
+ let sql = "SELECT COUNT(*) as cnt \
+ FROM (\
+ (SELECT id FROM t1) EXCEPT \
+ (SELECT id FROM t2)\
+ ) foo";
+ let actual = execute_to_batches(&ctx, sql).await;
+ // the purpose of this test is just to make sure the query produces a
valid plan
Review Comment:
Actually, I suppose the comment is valid because we are executing against an
empty batch.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]