libenchao commented on code in PR #2761:
URL: https://github.com/apache/calcite/pull/2761#discussion_r842328662
##########
core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java:
##########
@@ -5848,8 +5848,8 @@ private void checkLiteral2(String expression, String
expected) {
+ "(SELECT \"department_id\"\n"
+ "FROM \"foodmart\".\"employee\"\n"
+ "GROUP BY \"department_id\") \"t1\"\n"
- + "GROUP BY \"t1\".\"department_id\") \"t3\" ON
\"employee\".\"department_id\" = \"t3\".\"department_id0\""
- + " AND \"employee\".\"department_id\" = \"t3\".\"EXPR$0\"";
+ + "GROUP BY \"t1\".\"department_id\"\n"
Review Comment:
@rubenada Thanks for your review. These two tests was introduces in
CALCITE-3155 to verify RelToSql for empty values. The results was changed
because the filter pushed down.
Before my change, the RelNode tree is:
```
LogicalProject(department_id=[$7])
LogicalProject(employee_id=[$0], full_name=[$1], first_name=[$2],
last_name=[$3], position_id=[$4], position_title=[$5], store_id=[$6],
department_id=[$7], birth_date=[$8], hire_date=[$9], end_date=[$10],
salary=[$11], supervisor_id=[$12], education_level=[$13], marital_status=[$14],
gender=[$15], management_role=[$16], department_id0=[CAST($17):INTEGER],
EXPR$0=[CAST($18):INTEGER])
LogicalJoin(condition=[AND(=($7, $17), =($7, $18))], joinType=[inner])
JdbcTableScan(table=[[foodmart, employee]])
LogicalAggregate(group=[{0}], EXPR$0=[MIN($1)])
LogicalProject(department_id0=[$2], $f0=[$2])
LogicalJoin(condition=[true], joinType=[inner])
LogicalValues(tuples=[[]])
LogicalAggregate(group=[{0}])
LogicalProject(department_id=[$7])
JdbcTableScan(table=[[foodmart, employee]])
```
After my change, the RelNode tree is:
```
LogicalProject(department_id=[$7])
LogicalProject(employee_id=[$0], full_name=[$1], first_name=[$2],
last_name=[$3], position_id=[$4], position_title=[$5], store_id=[$6],
department_id=[$7], birth_date=[$8], hire_date=[$9], end_date=[$10],
salary=[$11], supervisor_id=[$12], education_level=[$13], marital_status=[$14],
gender=[$15], management_role=[$16], department_id0=[CAST($17):INTEGER],
EXPR$0=[CAST($18):INTEGER])
LogicalJoin(condition=[=($7, $17)], joinType=[inner])
JdbcTableScan(table=[[foodmart, employee]])
LogicalFilter(condition=[=($0, $1)])
LogicalAggregate(group=[{0}], EXPR$0=[MIN($1)])
LogicalProject(department_id0=[$2], $f0=[$2])
LogicalJoin(condition=[true], joinType=[inner])
LogicalValues(tuples=[[]])
LogicalAggregate(group=[{0}])
LogicalProject(department_id=[$7])
JdbcTableScan(table=[[foodmart, employee]])
```
The two RelNode tree is both valid, and the corresponding converted SQL is
also valid. Hence from my understanding, this is an expected result.
--
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]