joeyutong opened a new pull request, #4088:
URL: https://github.com/apache/calcite/pull/4088
In the existing test
```
// RelMetadataTest.java
@Test void testColumnUniquenessForJoinOnLimit1() {
final String sql = ""
+ "select *\n"
+ "from emp A\n"
+ "join (\n"
+ " select * from emp\n"
+ " limit 1) B\n"
+ "on A.empno = B.empno";
sql(sql)
.assertThatAreColumnsUnique(bitSetOf(0), is(true))
.assertThatAreColumnsUnique(bitSetOf(1), is(true))
.assertThatAreColumnsUnique(bitSetOf(9), is(true))
.assertThatAreColumnsUnique(bitSetOf(10), is(true))
.assertThatAreColumnsUnique(bitSetOf(), is(true))
.assertThatUniqueKeysAre(bitSetOf());
}
```
the join result column `A.ENAME` is considered to be unique because
`A.EMPNO` is the unique key. The test still passes when the query changes to
left join, in which case `A.ENAME` is not guaranteed to be unique.
--
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]