lowka commented on code in PR #2000:
URL: https://github.com/apache/ignite-3/pull/2000#discussion_r1183341193


##########
modules/runner/src/integrationTest/java/org/apache/ignite/internal/sql/engine/ItFunctionsTest.java:
##########
@@ -267,16 +271,40 @@ public void testTypeOf() {
         assertQuery("SELECT 
TYPEOF('a'::varchar(1))").returns("VARCHAR(1)").check();
         assertQuery("SELECT TYPEOF(NULL)").returns("NULL").check();
         assertQuery("SELECT 
TYPEOF(NULL::VARCHAR(100))").returns("VARCHAR(100)").check();
+        // A compound expression
+        assertQuery("SELECT TYPEOF('abcd' || COALESCE('efg', 
?))").withParams("2").returns("VARCHAR").check();
+
+        // An expression that produces an error
+        IgniteException failed = assertThrows(IgniteException.class, () -> 
assertQuery("SELECT typeof(CAST('NONE' as INTEGER))").check());
+        assertSame(NumberFormatException.class, failed.getCause().getClass(), 
"cause");
+        assertThat(failed.getCause().getMessage(), containsString("For input 
string: \"NONE\""));
+
         try {
             sql("SELECT TYPEOF()");
+            fail();

Review Comment:
   fixed.



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