xiedeyantu commented on code in PR #4748:
URL: https://github.com/apache/calcite/pull/4748#discussion_r2696281365


##########
core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java:
##########
@@ -6426,6 +6426,25 @@ private void checkLiteral2(String expression, String 
expected) {
     sql(query).withConfig(c -> c.withExpand(false)).ok(expected);
   }
 
+  /** Test case of
+   * <a 
href="https://issues.apache.org/jira/browse/CALCITE-7378";>[CALCITE-7378]
+   * Potential incorrect column attribution in RelToSqlConverter due to 
implicit
+   * table alias handling</a>. */
+  @Test void testSubQueryWithSelfJoin() {
+    String query = "select \"product_name\" from \"product\" t1 "
+        + "where \"product_id\" not in (select \"product_id\" "
+        + "from \"product\" t2 "
+        + "where t2.\"product_id\" = t1.\"product_id\" "
+        + "and t1.\"product_id\" = 2 and t2.\"product_id\" = 1)";
+    String expected = "SELECT \"product_name\"\n"

Review Comment:
   @zzwqqq I have a small suggestion: Jira doesn't provide the format you 
expect, which makes it less convenient for reviewers to quickly grasp your key 
points.



-- 
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]

Reply via email to