You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "abhioncbr (via GitHub)" <gi...@apache.org> on 2023/05/09 14:28:38 UTC

[GitHub] [pinot] abhioncbr commented on a diff in pull request #10739: [multistage] 10736: Fix for self join table names extraction in multistage

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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org