adriangb commented on code in PR #26274:
URL: https://github.com/apache/datafusion/pull/26274#discussion_r4618489886


##########
datafusion/expr/src/logical_plan/materialized_cte.rs:
##########
@@ -375,6 +492,113 @@ mod tests {
         Ok(())
     }
 
+    fn wide_schema() -> DFSchemaRef {
+        let schema = Schema::new(vec![
+            Field::new("a", DataType::Int32, true),
+            Field::new("b", DataType::Utf8, true),
+            Field::new("c", DataType::Float64, true),
+            Field::new("d", DataType::Boolean, true),
+        ]);
+        Arc::new(DFSchema::try_from_qualified_schema("c", &schema).unwrap())
+    }
+
+    fn names(scan: &MaterializedCteScan) -> Vec<String> {
+        scan.schema()
+            .columns()
+            .iter()
+            .map(|c| c.flat_name())
+            .collect()
+    }
+
+    #[test]
+    fn scan_projection_refers_to_the_body() -> Result<()> {

Review Comment:
   Good idea, done in 146a575



##########
datafusion/physical-plan/src/materialized_cte.rs:
##########
@@ -978,6 +1059,73 @@ mod tests {
         Ok(())
     }
 
+    /// A scan with a projection outputs the selected columns of the buffered
+    /// batches. A scan that selects no column keeps the row count.
+    #[tokio::test]
+    async fn scan_projection() -> Result<()> {

Review Comment:
   Added in 146a575



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