Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2003,7 +2003,7 @@ private SqlNode registerFrom(
usingScope,
alias,
new AliasNamespace(this, call, enclosingNode),
false);
forceNullable);
}
return node;
case MATCH_RECOGNIZE:
Expand Down
11 changes: 11 additions & 0 deletions core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4127,6 +4127,17 @@ public void _testWinPartClause() {
"RANK or DENSE_RANK functions require ORDER BY clause in window specification");
}

@Test public void testLeftOuterJoinWithAlias() {
final String query =
"select * from "
+ "(select row_number() over (order by sal) from emp) as emp1(r1) "
+ "left outer join "
+ "(select dense_rank() over(order by sal) from emp) as emp2(r2) "
+ "on (emp1.r1 = emp2.r2)";
// In this case, R2 is nullable in the join since we have a left outer join.
sql(query).type("RecordType(BIGINT NOT NULL R1, BIGINT R2) NOT NULL");
}

@Test public void testInvalidWindowFunctionWithGroupBy() {
sql("select max(^empno^) over () from emp\n"
+ "group by deptno")
Expand Down