You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2020/09/14 11:38:16 UTC

[GitHub] [cassandra] smiklosovic commented on a change in pull request #731: CASSANDRA-13935 - indexes and udts on snapshot schema.cql should contain if not exists clause

smiklosovic commented on a change in pull request #731:
URL: https://github.com/apache/cassandra/pull/731#discussion_r487845386



##########
File path: test/unit/org/apache/cassandra/cql3/validation/entities/UFJavaTest.java
##########
@@ -796,4 +801,55 @@ public void testAllNativeTypes() throws Throwable
                            "AS 'return 0;'");
         }
     }
+
+    @Test
+    public void testUDFToCqlString()
+    {
+        UDFunction function = UDFunction.create(new FunctionName("my_ks", "my_function"),
+                                                Arrays.asList(ColumnIdentifier.getInterned("column", false)),
+                                                Arrays.asList(UTF8Type.instance),
+                                                Int32Type.instance,
+                                                false,
+                                                "java",
+                                                "return 0;");
+
+        Assert.assertTrue(function.toCqlString(true, true).contains("CREATE FUNCTION IF NOT EXISTS"));
+        Assert.assertFalse(function.toCqlString(true, false).contains("CREATE FUNCTION IF NOT EXISTS"));

Review comment:
       added 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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org