alamb commented on code in PR #10612:
URL: https://github.com/apache/datafusion/pull/10612#discussion_r1609707420
##########
datafusion/sql/src/unparser/plan.rs:
##########
@@ -502,3 +505,35 @@ impl From<BuilderError> for DataFusionError {
DataFusionError::External(Box::new(e))
}
}
+
+#[cfg(test)]
+mod test {
+ use crate::unparser::plan_to_sql;
+ use arrow::datatypes::{DataType, Field, Schema};
+ use datafusion_expr::{col, logical_plan::table_scan};
+ #[test]
+ fn test_table_references_in_plan_to_sql() {
+ fn test(table_name: &str, expected_sql: &str) {
+ let schema = Schema::new(vec![
+ Field::new("id", DataType::Utf8, false),
+ Field::new("value", DataType::Utf8, false),
+ ]);
+ let plan = table_scan(Some(table_name), &schema, None)
Review Comment:
Since this is testing `plan_to_sql` it might make more sense to put it with
the rest of the tests for plan_to_sql:
https://github.com/apache/datafusion/blob/main/datafusion/sql/tests/sql_integration.rs#L4669
However, the fact that those tests don't have "plan_to_sql" in their name is
confusing too.
Maybe we could consolidate the tests into something like
`datafusion/sql/tests/sql_integration/plan_to_sql.rs` 🤔 (as a follow on PR)
--
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]