bit2swaz commented on code in PR #27589:
URL: https://github.com/apache/datafusion/pull/27589#discussion_r4632575906


##########
datafusion/proto/tests/cases/plans/dynamic_filters.rs:
##########
@@ -1111,3 +1111,36 @@ fn extension_codec_expr_participates_in_deduplication() 
-> Result<()> {
 
     Ok(())
 }
+
+/// <https://github.com/apache/datafusion/issues/27543>
+#[tokio::test]
+async fn test_dynamic_filter_roundtrip_after_execution_and_reset() -> 
Result<()> {
+    let dir = tempfile::tempdir()?;
+    let path = dir.path().to_str().unwrap();
+    let ctx = SessionContext::new();
+    for (name, end) in [("big", 201), ("small", 4)] {
+        ctx.sql(&format!("COPY (SELECT value AS id FROM range(1, {end})) TO 
'{path}/{name}/t.parquet' STORED AS PARQUET"))
+            .await?
+            .collect()
+            .await?;
+        ctx.register_parquet(name, format!("{path}/{name}"), 
Default::default())
+            .await?;
+    }
+
+    for (sql, expected) in [
+        ("SELECT * FROM big ORDER BY id LIMIT 1", 1),
+        ("SELECT * FROM big ORDER BY id DESC LIMIT 3", 3),

Review Comment:
   added `SELECT min(id), max(id) FROM big WHERE id % 2 = 0`. without the 
`WHERE` it gets answered from parquet stats and no aggregate runs. the test 
also compares the actual output now and not just row counts



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to