You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "mihaibudiu (via GitHub)" <gi...@apache.org> on 2024/01/26 01:30:35 UTC

[PR] [CALCITE-6227] ELEMENT(NULL) causes an assertion failure [calcite]

mihaibudiu opened a new pull request, #3652:
URL: https://github.com/apache/calcite/pull/3652

   (no comment)


-- 
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: commits-unsubscribe@calcite.apache.org

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


Re: [PR] [CALCITE-6227] ELEMENT(NULL) causes an assertion failure [calcite]

Posted by "JiajunBernoulli (via GitHub)" <gi...@apache.org>.
JiajunBernoulli commented on code in PR #3652:
URL: https://github.com/apache/calcite/pull/3652#discussion_r1467614123


##########
core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java:
##########
@@ -1934,6 +1934,10 @@ void testLikeAndSimilarFails() {
         .columnType("DOUBLE NOT NULL");
     expr("element(multiset[multiset[cast(null as tinyint)]])")
         .columnType("TINYINT MULTISET NOT NULL");
+    // Test case for <a href="https://issues.apache.org/jira/projects/CALCITE/issues/CALCITE-6227">

Review Comment:
   Is the `a tag` valid here?



##########
core/src/main/java/org/apache/calcite/sql/type/ReturnTypes.java:
##########
@@ -574,13 +574,13 @@ public static SqlCall stripSeparator(SqlCall call) {
                 RelDataType type =
                     opBinding.getOperandType(index)
                         .getComponentType();
-                assert type != null;
+                if (type == null) {

Review Comment:
   LGTM



-- 
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: commits-unsubscribe@calcite.apache.org

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


Re: [PR] [CALCITE-6227] ELEMENT(NULL) causes an assertion failure [calcite]

Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu commented on code in PR #3652:
URL: https://github.com/apache/calcite/pull/3652#discussion_r1467141615


##########
core/src/main/java/org/apache/calcite/sql/type/ReturnTypes.java:
##########
@@ -574,13 +574,13 @@ public static SqlCall stripSeparator(SqlCall call) {
                 RelDataType type =
                     opBinding.getOperandType(index)
                         .getComponentType();
-                assert type != null;
+                if (type == null) {
+                  return opBinding.getTypeFactory().createSqlType(SqlTypeName.NULL);
+                }
                 return type;
               }
 
-              @Override public int size() {
-                return opBinding.getOperandCount();
-              }
+              @Override public int size() { return opBinding.getOperandCount(); }

Review Comment:
   I reindented this line because checkStyle was upset about it.



-- 
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: commits-unsubscribe@calcite.apache.org

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


Re: [PR] [CALCITE-6227] ELEMENT(NULL) causes an assertion failure [calcite]

Posted by "mihaibudiu (via GitHub)" <gi...@apache.org>.
mihaibudiu merged PR #3652:
URL: https://github.com/apache/calcite/pull/3652


-- 
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: commits-unsubscribe@calcite.apache.org

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