alamb commented on code in PR #4333:
URL: https://github.com/apache/arrow-datafusion/pull/4333#discussion_r1032786474


##########
datafusion/core/src/datasource/view.rs:
##########
@@ -474,7 +474,8 @@ mod tests {
         let formatted = arrow::util::pretty::pretty_format_batches(&plan)
             .unwrap()
             .to_string();
-        assert!(formatted.contains("ParquetExec: limit=Some(10)"));
+        // TODO: limit_push_down support SubqueryAlias

Review Comment:
   We should perhaps track this with a ticket -- it seems like it is a 
regression not to push limits into the subquery
   
   



##########
datafusion/expr/src/logical_plan/builder.rs:
##########
@@ -980,19 +977,26 @@ pub fn project_with_alias(
         exprlist_to_fields(&projected_expr, &plan)?,
         plan.schema().metadata().clone(),
     )?;
-    let schema = match alias {
-        Some(ref alias) => input_schema.replace_qualifier(alias.as_str()),
-        None => input_schema,
-    };
 
-    Ok(LogicalPlan::Projection(
-        Projection::try_new_with_schema_alias(
-            projected_expr,
-            Arc::new(plan.clone()),
-            DFSchemaRef::new(schema),
-            alias,
-        )?,
-    ))
+    let projection = LogicalPlan::Projection(Projection::try_new_with_schema(
+        projected_expr,
+        Arc::new(plan.clone()),
+        DFSchemaRef::new(input_schema),
+    )?);
+    match alias {
+        Some(alias) => Ok(with_alias(projection, alias)),
+        None => Ok(projection),
+    }
+}
+
+pub fn with_alias(plan: LogicalPlan, alias: String) -> LogicalPlan {

Review Comment:
   Could you please add some docstrings to this function (perhaps 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]

Reply via email to