askoa opened a new issue, #4898:
URL: https://github.com/apache/arrow-datafusion/issues/4898
**Describe the bug**
The function used to trace LogicalPlan `LogicalPlan::display_indent()` does
not display subqueries when the enclosing `Expr` is wrapped in `Expr::Alias`.
Note: I'll pick this up.
**To Reproduce**
The below test will fail
```
#[test]
fn test_display_subquery_alias() -> Result<()> {
let plan1 = table_scan(Some("employee_csv"), &employee_schema(),
Some(vec![3]))?
.build()?;
let plan1 = Arc::new(plan1);
let plan = table_scan(Some("employee_csv"), &employee_schema(),
Some(vec![0, 3]))?
.project(vec![col("id"), exists(plan1).alias("exists")])?
.build();
let expected = "Projection: employee_csv.id, EXISTS (<subquery>) AS
exists\
\n Subquery:\
\n TableScan: employee_csv projection=[state]\
\n TableScan: employee_csv projection=[id, state]";
assert_eq!(expected, format!("{}", plan?.display_indent()));
Ok(())
}
```
**Expected behavior**
The subquery should be displayed in the output and the above test should
pass.
**Additional context**
The function `LogicalPlan::collect_subqueries` does not look for subqueries
in `Expr::Alias`.
--
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]