mihaibudiu commented on code in PR #3856:
URL: https://github.com/apache/calcite/pull/3856#discussion_r1678413825


##########
core/src/main/java/org/apache/calcite/rel/rel2sql/RelToSqlConverter.java:
##########
@@ -397,7 +397,7 @@ private boolean isCommaJoin(Join join) {
   public Result visit(Correlate e) {
     final Result leftResult =
         visitInput(e, 0)
-            .resetAlias(e.getCorrelVariable(), e.getRowType());
+            .resetAlias(e.getCorrelVariable(), e.getInput(0).getRowType());

Review Comment:
   this seems like a pretty big bug, I wonder how it wasn't discovered sooner
   Is it because for correlated queries the type of e is often the same as the 
type of e.getInput(0)?



##########
core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterStructsTest.java:
##########
@@ -41,11 +41,9 @@ private RelToSqlConverterTest.Sql sql(String sql) {
 
   @Test void testNestedSchemaSelectStar() {
     String query = "SELECT * FROM \"myTable\"";
-    String expected = "SELECT \"a\", "
-        + "ROW(ROW(\"n1\".\"n11\".\"b\"), ROW(\"n1\".\"n12\".\"c\")) AS 
\"n1\", "
-        + "ROW(\"n2\".\"d\") AS \"n2\", "
-        + "\"e\"\n"
-        + "FROM \"myDb\".\"myTable\"";
+    String expected = "SELECT \"a\", ROW(ROW(\"n1\".\"n11\".\"b\"), "

Review Comment:
   In fact, is there any difference here?



##########
core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterStructsTest.java:
##########
@@ -41,11 +41,9 @@ private RelToSqlConverterTest.Sql sql(String sql) {
 
   @Test void testNestedSchemaSelectStar() {
     String query = "SELECT * FROM \"myTable\"";
-    String expected = "SELECT \"a\", "
-        + "ROW(ROW(\"n1\".\"n11\".\"b\"), ROW(\"n1\".\"n12\".\"c\")) AS 
\"n1\", "
-        + "ROW(\"n2\".\"d\") AS \"n2\", "
-        + "\"e\"\n"
-        + "FROM \"myDb\".\"myTable\"";
+    String expected = "SELECT \"a\", ROW(ROW(\"n1\".\"n11\".\"b\"), "

Review Comment:
   I would refrain for reformatting the string to make the comparison easier



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