alamb commented on a change in pull request #8839:
URL: https://github.com/apache/arrow/pull/8839#discussion_r537789220
##########
File path: rust/datafusion/src/logical_plan/display.rs
##########
@@ -241,26 +246,43 @@ impl<'a, 'b> PlanVisitor for GraphvizVisitor<'a, 'b> {
#[cfg(test)]
mod tests {
- use arrow::datatypes::{DataType, Field};
-
use super::*;
+ use crate::error::Result;
+ use crate::logical_plan::DFField;
+ use arrow::datatypes::DataType;
#[test]
- fn test_display_empty_schema() {
- let schema = Schema::new(vec![]);
+ fn test_display_empty_schema() -> Result<()> {
+ let schema = DFSchema::new(vec![])?;
assert_eq!("[]", format!("{}", display_schema(&schema)));
+ Ok(())
}
#[test]
- fn test_display_schema() {
- let schema = Schema::new(vec![
- Field::new("id", DataType::Int32, false),
- Field::new("first_name", DataType::Utf8, true),
- ]);
+ fn test_display_schema() -> Result<()> {
+ let schema = DFSchema::new(vec![
+ DFField::new(None, "id", DataType::Int32, false),
+ DFField::new(None, "first_name", DataType::Utf8, true),
+ ])?;
assert_eq!(
"[id:Int32, first_name:Utf8;N]",
format!("{}", display_schema(&schema))
);
+ Ok(())
+ }
+
+ #[test]
+ fn test_display_qualified_schema() -> Result<()> {
Review comment:
👍
##########
File path: rust/datafusion/src/physical_plan/mod.rs
##########
@@ -62,7 +62,7 @@ pub trait ExecutionPlan: Debug + Send + Sync {
/// downcast to a specific implementation.
fn as_any(&self) -> &dyn Any;
/// Get the schema for this execution plan
- fn schema(&self) -> SchemaRef;
+ fn schema(&self) -> DFSchemaRef;
Review comment:
When I was saying "physical plan doesn't use DFSchema` I guess I was
imagining that `ExecutionPlan::schema()` continued to return `SchemaRef` --
there may be some reason that `ExecutionPlan` needs to return a DFSchema, but I
think the design would be cleaner if we avoided this
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]