You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "korlov42 (via GitHub)" <gi...@apache.org> on 2026/01/07 12:24:37 UTC

[PR] IGNITE-26637 Introduce support of scalar expressions [ignite-3]

korlov42 opened a new pull request, #7355:
URL: https://github.com/apache/ignite-3/pull/7355

   https://issues.apache.org/jira/browse/IGNITE-26637
   
   ----
   Thank you for submitting the pull request.
   
   To streamline the review process of the patch and ensure better code quality
   we ask both an author and a reviewer to verify the following:
   
   ### The Review Checklist
   - [ ] **Formal criteria:** TC status, codestyle, mandatory documentation. Also make sure to complete the following:  
   \- There is a single JIRA ticket related to the pull request.  
   \- The web-link to the pull request is attached to the JIRA ticket.  
   \- The JIRA ticket has the Patch Available state.  
   \- The description of the JIRA ticket explains WHAT was made, WHY and HOW.  
   \- The pull request title is treated as the final commit message. The following pattern must be used: IGNITE-XXXX Change summary where XXXX - number of JIRA issue.
   - [ ] **Design:** new code conforms with the design principles of the components it is added to.
   - [ ] **Patch quality:** patch cannot be split into smaller pieces, its size must be reasonable.
   - [ ] **Code quality:** code is clean and readable, necessary developer documentation is added if needed.
   - [ ] **Tests code quality:** test set covers positive/negative scenarios, happy/edge cases. Tests are effective in terms of execution time and resources.
   
   ### Notes
   - [Apache Ignite Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Java+Code+Style+Guide)


-- 
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: notifications-unsubscribe@ignite.apache.org

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


Re: [PR] IGNITE-26637 Introduce support of scalar expressions [ignite-3]

Posted by "korlov42 (via GitHub)" <gi...@apache.org>.
korlov42 merged PR #7355:
URL: https://github.com/apache/ignite-3/pull/7355


-- 
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: notifications-unsubscribe@ignite.apache.org

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


Re: [PR] IGNITE-26637 Introduce support of scalar expressions [ignite-3]

Posted by "korlov42 (via GitHub)" <gi...@apache.org>.
korlov42 commented on code in PR #7355:
URL: https://github.com/apache/ignite-3/pull/7355#discussion_r2681696191


##########
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:
   fixed, thanks



-- 
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: notifications-unsubscribe@ignite.apache.org

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


Re: [PR] IGNITE-26637 Introduce support of scalar expressions [ignite-3]

Posted by "korlov42 (via GitHub)" <gi...@apache.org>.
korlov42 commented on code in PR #7355:
URL: https://github.com/apache/ignite-3/pull/7355#discussion_r2681703332


##########
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:
   initially I thought it doesn't worth the hassle, but turns out setup for the test is not that bad, hence test has been added. Thanks for highlighting



-- 
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: notifications-unsubscribe@ignite.apache.org

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


Re: [PR] IGNITE-26637 Introduce support of scalar expressions [ignite-3]

Posted by "xtern (via GitHub)" <gi...@apache.org>.
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: notifications-unsubscribe@ignite.apache.org

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