abhioncbr commented on code in PR #10739:
URL: https://github.com/apache/pinot/pull/10739#discussion_r1188695827
##########
pinot-common/src/test/java/org/apache/pinot/sql/parsers/CalciteSqlCompilerTest.java:
##########
@@ -3223,5 +3231,22 @@ public void testJoin() {
Assert.assertEquals(rightSubquery,
CalciteSqlParser.compileToPinotQuery("SELECT key, COUNT(*) AS b FROM
T3 JOIN T4 GROUP BY key"));
Assert.assertEquals(join.getCondition(),
CalciteSqlParser.compileToExpression("T1.key = T2.key"));
+
+ // test for self join queries
+ query = "SELECT T1.a FROM T1 JOIN(SELECT key FROM T1) as self ON
T1.key=self.key";
Review Comment:
As per the[ PG documentation
](https://www.postgresql.org/docs/current/sql-keywords-appendix.html), `self`
is a non-reserved keyword. There is no difference between `self` and `AS T2`.
The issue was because of alias(`AS`) usage, not with `self`
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]