You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "gabotechs (via GitHub)" <gi...@apache.org> on 2026/03/24 13:55:30 UTC
Re: [PR] Substrait join consumer should not merge nullability of join keys [datafusion]
gabotechs commented on code in PR #21121:
URL: https://github.com/apache/datafusion/pull/21121#discussion_r2981776732
##########
datafusion/substrait/tests/cases/consumer_integration.rs:
##########
@@ -33,6 +35,32 @@ mod tests {
use std::io::BufReader;
use substrait::proto::Plan;
+ async fn execute_plan(name: &str) -> Result<Vec<RecordBatch>> {
+ let path = format!("tests/testdata/test_plans/{name}");
+ let proto = serde_json::from_reader::<_, Plan>(BufReader::new(
+ File::open(path).expect("file not found"),
+ ))
+ .expect("failed to parse json");
+ let ctx = SessionContext::new();
+ let plan = from_substrait_plan(&ctx.state(), &proto).await?;
+ ctx.execute_logical_plan(plan).await?.collect().await
+ }
+
+ /// Pretty-print batches as a table with header on top and data rows sorted.
+ fn pretty_sorted(batches: &[RecordBatch]) -> String {
+ let pretty = pretty_format_batches(batches).unwrap().to_string();
+ let all_lines: Vec<&str> = pretty.trim().lines().collect();
+ let header = &all_lines[..3];
+ let mut data: Vec<&str> = all_lines[3..all_lines.len() - 1].to_vec();
+ data.sort();
+ header
+ .iter()
+ .copied()
+ .chain(data)
+ .collect::<Vec<_>>()
+ .join("\n")
Review Comment:
This seems to be truncating the footer (just the last line of the table that gives closure to it), making the assertion look like it's incomplete. How about re-adding the footer here, just so that it's clearer to readers that the `insta` assertions are actually complete and where not truncated?
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org