Skip to content

Commit

Permalink
Verify negative SUPPORTS_CREATE_FUNCTION declarations
Browse files Browse the repository at this point in the history
When `BaseConnectorTest` implementation declares that it does not have
`SUPPORTS_CREATE_FUNCTION` behavior, verify this is true.
  • Loading branch information
findepi committed Nov 17, 2023
1 parent 1f6792b commit 4055fdf
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6553,7 +6553,14 @@ private void testMaterializedViewColumnName(String columnName, boolean delimited
@Test
public void testCreateFunction()
{
skipTestUnless(hasBehavior(SUPPORTS_CREATE_FUNCTION));
if (!hasBehavior(SUPPORTS_CREATE_FUNCTION)) {
String catalog = getQueryRunner().getDefaultSession().getCatalog().orElseThrow();
String schema = getQueryRunner().getDefaultSession().getSchema().orElseThrow();
assertQueryFails(
"CREATE FUNCTION " + catalog + "." + schema + ".test_create_function" + randomNameSuffix() + "(x integer) RETURNS bigint COMMENT 't42' RETURN x * 42",
"This connector does not support creating functions");
return;
}

String name = "test_" + randomNameSuffix();
String name2 = "test_" + randomNameSuffix();
Expand Down

0 comments on commit 4055fdf

Please sign in to comment.