Dwrite commented on code in PR #4692:
URL: https://github.com/apache/calcite/pull/4692#discussion_r2637829353


##########
core/src/test/java/org/apache/calcite/rel/rel2sql/RelToSqlConverterTest.java:
##########
@@ -11462,4 +11463,196 @@ public Sql schema(CalciteAssert.SchemaSpec 
schemaSpec) {
           relFn, transforms);
     }
   }
+

Review Comment:
   Yes, I have validated the generated SQL against ClickHouse version 25.12 
(and earlier stable versions).
   
   Validation Details:
   
   Scoping Issue: Initially, I tried using a simple SELECT * wrapper, but 
ClickHouse threw an UNKNOWN_IDENTIFIER error because it couldn't resolve 
internal table qualifiers (e.g., d2.loc) through a subquery alias.
   
   Final Logic: The current implementation of explicit aliasing (original_expr 
AS target_name) was specifically designed to solve this. I manually executed 
the output of the provided test cases in a ClickHouse environment to ensure:
   
   Nested joins are syntactically accepted.
   
   All projected columns are correctly resolved in the outer ON clauses and 
SELECT blocks.
   
   Result: The flattened aliasing approach resolved the resolution errors and 
successfully returned the expected data in ClickHouse.
   
   I've also verified that this change does not introduce redundant nesting for 
other dialects.



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