ygf11 commented on code in PR #4826:
URL: https://github.com/apache/arrow-datafusion/pull/4826#discussion_r1069157559
##########
datafusion/core/tests/sql/subqueries.rs:
##########
@@ -94,12 +94,13 @@ where o_orderstatus in (
let dataframe = ctx.sql(sql).await.unwrap();
let plan = dataframe.into_optimized_plan().unwrap();
let actual = format!("{}", plan.display_indent());
- let expected = r#"Projection: orders.o_orderkey
- LeftSemi Join: orders.o_orderstatus = __correlated_sq_1.l_linestatus,
orders.o_orderkey = __correlated_sq_1.l_orderkey
- TableScan: orders projection=[o_orderkey, o_orderstatus]
- SubqueryAlias: __correlated_sq_1
- Projection: lineitem.l_linestatus AS l_linestatus, lineitem.l_orderkey
AS l_orderkey
- TableScan: lineitem projection=[l_orderkey, l_linestatus]"#;
+
Review Comment:
Not only `whitespace`, the alias except the first expression are removed in
the projection.
before:
```sql
SubqueryAlias: __correlated_sq_1
Projection: lineitem.l_linestatus AS l_linestatus, lineitem.l_orderkey
AS l_orderkey
```
after:
```sql
\n SubqueryAlias: __correlated_sq_1\
\n Projection: lineitem.l_linestatus AS l_linestatus,
lineitem.l_orderkey\
```
The first expression of the projection is the right side of `in-equijoin`,
it may be a non-column expression, so always give it an alias, but others do
not(they are alway column).
--
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]