xtern commented on code in PR #7355:
URL: https://github.com/apache/ignite-3/pull/7355#discussion_r2681249552


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/IgniteSqlToRelConverter.java:
##########
@@ -145,14 +145,50 @@ public SqlNode validateExpression(RelDataType rowType, 
SqlNode expr) {
      *
      * @param node The AST root to convert.
      * @param scope The scope to use to resolve column reference, if any.
-     * @param inputRowType The input row type. Should be provided if 
expression contains any column references.
+     * @param inputRowTypes The types of the input which can be referenced in 
the expression.
+     *      Should be provided if expression contains any column references.
      * @return A converted expression tree.
      */
-    public RexNode convertExpressionExt(SqlNode node, SqlValidatorScope scope, 
@Nullable RelDataType inputRowType) {
+    public RexNode convertExpressionExt(SqlNode node, SqlValidatorScope scope, 
RelDataType... inputRowTypes) {

Review Comment:
   do we have/can we add tests for this change?



##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/prepare/IgniteTypeCoercion.java:
##########
@@ -625,16 +624,22 @@ RelDataType syncAttributes(
         }
     }
 
-    private static SqlNode castTo(SqlNode node, RelDataType type) {
-        SqlDataTypeSpec targetDataType;
-        if (type.getSqlTypeName() == SqlTypeName.UUID) {
-            targetDataType = new SqlDataTypeSpec(
-                    new SqlBasicTypeNameSpec(SqlTypeName.UUID, 
SqlParserPos.ZERO), null, type.isNullable(), SqlParserPos.ZERO
-            );
-        } else {
-            targetDataType = 
SqlTypeUtil.convertTypeToSpec(type).withNullable(type.isNullable());
+    /** Wraps given expression in CAST iff given expressions is not of 
provided type and implicit cast exists. */

Review Comment:
   I think the wording of the comment needs to be improved, something like
   ```suggestion
       /** Wraps the given expression in CAST if it is not of the specified 
type and such implicit cast is allowed. */
   ```



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