You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "zstan (via GitHub)" <gi...@apache.org> on 2023/06/20 07:32:42 UTC

[GitHub] [ignite-3] zstan opened a new pull request, #2223: IGNITE-19668 Sql. Fix testLengthExpressionWithDynamicParameter

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

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

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


[GitHub] [ignite-3] zstan commented on pull request #2223: IGNITE-19668 Sql. Fix testLengthExpressionWithDynamicParameter

Posted by "zstan (via GitHub)" <gi...@apache.org>.
zstan commented on PR #2223:
URL: https://github.com/apache/ignite-3/pull/2223#issuecomment-1609439821

   @lowka @korlov42 new approach is ready for review, can u take a look plz ?


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


[GitHub] [ignite-3] AMashenkov merged pull request #2223: IGNITE-19668 Sql. Fix testLengthExpressionWithDynamicParameter

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


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


[GitHub] [ignite-3] zstan commented on a diff in pull request #2223: IGNITE-19668 Sql. Fix testLengthExpressionWithDynamicParameter

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


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/datatypes/varbinary/ItVarBinaryExpressionTest.java:
##########
@@ -67,24 +67,32 @@ public void testPositionExpressionWithDynamicParameter() {
                 .check();
     }
 
-    /** {@code LENGTH} expression. */
-    @Disabled("https://issues.apache.org/jira/browse/IGNITE-19668")
+    /** {@code LENGTH} and {@code OCTET_LENGTH} expression. */
     @Test
     public void testLengthExpression() {
         checkQuery("SELECT LENGTH(x'010203')")
-                .withParams(varBinary(new byte[]{2}))
+                .returns(3).check();
+
+        checkQuery("SELECT OCTET_LENGTH(x'010203')")
                 .returns(3).check();
     }
 
-    /** {@code LENGTH} expression. */
-    @Disabled("https://issues.apache.org/jira/browse/IGNITE-19668")
+    /** {@code LENGTH} and {@code OCTET_LENGTH} expression with dynamic params. */
     @Test
     public void testLengthExpressionWithDynamicParameter() {
-        checkQuery("SELECT LENGTH(?)")
+        checkQuery("SELECT OCTET_LENGTH(?)")
+                .withParams(varBinary(new byte[]{1, 2, 3}))
+                .returns(3).check();
+
+        checkQuery("SELECT OCTET_LENGTH(?)")
+                .withParams(varBinary(new byte[0]))
+                .returns(0).check();
+
+        checkQuery("SELECT LENGTH(CAST (? AS VARCHAR))")
                 .withParams(varBinary(new byte[]{1, 2, 3}))
                 .returns(3).check();
 
-        checkQuery("SELECT LENGTH(?)")
+        checkQuery("SELECT LENGTH(CAST (? AS VARCHAR))")

Review Comment:
   just to make sure that it works with cast too



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


[GitHub] [ignite-3] zstan commented on a diff in pull request #2223: IGNITE-19668 Sql. Fix testLengthExpressionWithDynamicParameter

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


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/datatypes/varbinary/ItVarBinaryExpressionTest.java:
##########
@@ -67,24 +67,32 @@ public void testPositionExpressionWithDynamicParameter() {
                 .check();
     }
 
-    /** {@code LENGTH} expression. */
-    @Disabled("https://issues.apache.org/jira/browse/IGNITE-19668")
+    /** {@code LENGTH} and {@code OCTET_LENGTH} expression. */
     @Test
     public void testLengthExpression() {
         checkQuery("SELECT LENGTH(x'010203')")
-                .withParams(varBinary(new byte[]{2}))
+                .returns(3).check();
+
+        checkQuery("SELECT OCTET_LENGTH(x'010203')")
                 .returns(3).check();
     }
 
-    /** {@code LENGTH} expression. */
-    @Disabled("https://issues.apache.org/jira/browse/IGNITE-19668")
+    /** {@code LENGTH} and {@code OCTET_LENGTH} expression with dynamic params. */
     @Test
     public void testLengthExpressionWithDynamicParameter() {
-        checkQuery("SELECT LENGTH(?)")
+        checkQuery("SELECT OCTET_LENGTH(?)")
+                .withParams(varBinary(new byte[]{1, 2, 3}))
+                .returns(3).check();
+
+        checkQuery("SELECT OCTET_LENGTH(?)")
+                .withParams(varBinary(new byte[0]))
+                .returns(0).check();
+
+        checkQuery("SELECT LENGTH(CAST (? AS VARCHAR))")
                 .withParams(varBinary(new byte[]{1, 2, 3}))
                 .returns(3).check();
 
-        checkQuery("SELECT LENGTH(?)")
+        checkQuery("SELECT LENGTH(CAST (? AS VARCHAR))")

Review Comment:
   yes, cast from varbinary to varchar returns the expected result.



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


[GitHub] [ignite-3] zstan commented on pull request #2223: IGNITE-19668 Sql. Fix testLengthExpressionWithDynamicParameter

Posted by "zstan (via GitHub)" <gi...@apache.org>.
zstan commented on PR #2223:
URL: https://github.com/apache/ignite-3/pull/2223#issuecomment-1598372074

   @lowka can u make a review plz ?


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


[GitHub] [ignite-3] korlov42 commented on a diff in pull request #2223: IGNITE-19668 Sql. Fix testLengthExpressionWithDynamicParameter

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


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/datatypes/varbinary/ItVarBinaryExpressionTest.java:
##########
@@ -67,24 +67,32 @@ public void testPositionExpressionWithDynamicParameter() {
                 .check();
     }
 
-    /** {@code LENGTH} expression. */
-    @Disabled("https://issues.apache.org/jira/browse/IGNITE-19668")
+    /** {@code LENGTH} and {@code OCTET_LENGTH} expression. */
     @Test
     public void testLengthExpression() {
         checkQuery("SELECT LENGTH(x'010203')")
-                .withParams(varBinary(new byte[]{2}))
+                .returns(3).check();
+
+        checkQuery("SELECT OCTET_LENGTH(x'010203')")
                 .returns(3).check();
     }
 
-    /** {@code LENGTH} expression. */
-    @Disabled("https://issues.apache.org/jira/browse/IGNITE-19668")
+    /** {@code LENGTH} and {@code OCTET_LENGTH} expression with dynamic params. */
     @Test
     public void testLengthExpressionWithDynamicParameter() {
-        checkQuery("SELECT LENGTH(?)")
+        checkQuery("SELECT OCTET_LENGTH(?)")
+                .withParams(varBinary(new byte[]{1, 2, 3}))
+                .returns(3).check();
+
+        checkQuery("SELECT OCTET_LENGTH(?)")
+                .withParams(varBinary(new byte[0]))
+                .returns(0).check();
+
+        checkQuery("SELECT LENGTH(CAST (? AS VARCHAR))")
                 .withParams(varBinary(new byte[]{1, 2, 3}))
                 .returns(3).check();
 
-        checkQuery("SELECT LENGTH(?)")
+        checkQuery("SELECT LENGTH(CAST (? AS VARCHAR))")

Review Comment:
   why do you put CAST operator for last two cases?



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


[GitHub] [ignite-3] korlov42 commented on a diff in pull request #2223: IGNITE-19668 Sql. Fix testLengthExpressionWithDynamicParameter

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


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/datatypes/varbinary/ItVarBinaryExpressionTest.java:
##########
@@ -67,24 +67,32 @@ public void testPositionExpressionWithDynamicParameter() {
                 .check();
     }
 
-    /** {@code LENGTH} expression. */
-    @Disabled("https://issues.apache.org/jira/browse/IGNITE-19668")
+    /** {@code LENGTH} and {@code OCTET_LENGTH} expression. */
     @Test
     public void testLengthExpression() {
         checkQuery("SELECT LENGTH(x'010203')")
-                .withParams(varBinary(new byte[]{2}))
+                .returns(3).check();
+
+        checkQuery("SELECT OCTET_LENGTH(x'010203')")
                 .returns(3).check();
     }
 
-    /** {@code LENGTH} expression. */
-    @Disabled("https://issues.apache.org/jira/browse/IGNITE-19668")
+    /** {@code LENGTH} and {@code OCTET_LENGTH} expression with dynamic params. */
     @Test
     public void testLengthExpressionWithDynamicParameter() {
-        checkQuery("SELECT LENGTH(?)")
+        checkQuery("SELECT OCTET_LENGTH(?)")
+                .withParams(varBinary(new byte[]{1, 2, 3}))
+                .returns(3).check();
+
+        checkQuery("SELECT OCTET_LENGTH(?)")
+                .withParams(varBinary(new byte[0]))
+                .returns(0).check();
+
+        checkQuery("SELECT LENGTH(CAST (? AS VARCHAR))")
                 .withParams(varBinary(new byte[]{1, 2, 3}))
                 .returns(3).check();
 
-        checkQuery("SELECT LENGTH(?)")
+        checkQuery("SELECT LENGTH(CAST (? AS VARCHAR))")

Review Comment:
   by "it" did you mean LENGTH?



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


[GitHub] [ignite-3] korlov42 commented on a diff in pull request #2223: IGNITE-19668 Sql. Fix testLengthExpressionWithDynamicParameter

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


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/datatypes/varbinary/ItVarBinaryExpressionTest.java:
##########
@@ -67,24 +67,32 @@ public void testPositionExpressionWithDynamicParameter() {
                 .check();
     }
 
-    /** {@code LENGTH} expression. */
-    @Disabled("https://issues.apache.org/jira/browse/IGNITE-19668")
+    /** {@code LENGTH} and {@code OCTET_LENGTH} expression. */
     @Test
     public void testLengthExpression() {
         checkQuery("SELECT LENGTH(x'010203')")
-                .withParams(varBinary(new byte[]{2}))
+                .returns(3).check();
+
+        checkQuery("SELECT OCTET_LENGTH(x'010203')")
                 .returns(3).check();
     }
 
-    /** {@code LENGTH} expression. */
-    @Disabled("https://issues.apache.org/jira/browse/IGNITE-19668")
+    /** {@code LENGTH} and {@code OCTET_LENGTH} expression with dynamic params. */
     @Test
     public void testLengthExpressionWithDynamicParameter() {
-        checkQuery("SELECT LENGTH(?)")
+        checkQuery("SELECT OCTET_LENGTH(?)")
+                .withParams(varBinary(new byte[]{1, 2, 3}))
+                .returns(3).check();
+
+        checkQuery("SELECT OCTET_LENGTH(?)")
+                .withParams(varBinary(new byte[0]))
+                .returns(0).check();
+
+        checkQuery("SELECT LENGTH(CAST (? AS VARCHAR))")
                 .withParams(varBinary(new byte[]{1, 2, 3}))
                 .returns(3).check();
 
-        checkQuery("SELECT LENGTH(?)")
+        checkQuery("SELECT LENGTH(CAST (? AS VARCHAR))")

Review Comment:
   well, and what is expected result in this case? 
   



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