Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import java.util.Optional;

import static io.trino.testing.sql.TestTable.randomTableSuffix;
Comment thread
grantatspothero marked this conversation as resolved.
Outdated
import static org.testng.Assert.assertEquals;

public abstract class AbstractKuduWithStandardInferSchemaConnectorTest
Expand All @@ -33,4 +34,22 @@ public void testListingOfTableForDefaultSchema()
{
assertEquals(computeActual("SHOW TABLES FROM default").getRowCount(), 0);
}

@Test
@Override
public void testDropNonEmptySchema()
{
// Set column and table properties in CREATE TABLE statement
String schemaName = "test_drop_non_empty_schema_" + randomTableSuffix();

try {
assertUpdate("CREATE SCHEMA " + schemaName);
assertUpdate("CREATE TABLE " + schemaName + ".t(x int WITH (primary_key=true)) WITH (partition_by_hash_columns=ARRAY['x'], partition_by_hash_buckets=2)");
assertQueryFails("DROP SCHEMA " + schemaName, ".*Cannot drop non-empty schema '\\Q" + schemaName + "\\E'");
}
finally {
assertUpdate("DROP TABLE IF EXISTS " + schemaName + ".t");
assertUpdate("DROP SCHEMA IF EXISTS " + schemaName);
}
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.trino.plugin.kudu;

import static io.trino.plugin.kudu.TestingKuduServer.LATEST_TAG;

public class TestKuduLatestWithDisabledInferSchemaConnectorTest
extends AbstractKuduWithDisabledInferSchemaConnectorTest
{
@Override
protected String getKuduServerVersion()
{
return LATEST_TAG;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.trino.plugin.kudu;

import static io.trino.plugin.kudu.TestingKuduServer.LATEST_TAG;

public class TestKuduLatestWithEmptyInferSchemaConnectorTest
extends AbstractKuduWithEmptyInferSchemaConnectorTest
{
@Override
protected String getKuduServerVersion()
{
return LATEST_TAG;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.trino.plugin.kudu;

import static io.trino.plugin.kudu.TestingKuduServer.LATEST_TAG;

public class TestKuduLatestWithStandardInferSchemaConnectorTest
extends AbstractKuduWithStandardInferSchemaConnectorTest
{
@Override
protected String getKuduServerVersion()
{
return LATEST_TAG;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.trino.plugin.kudu;

import static io.trino.plugin.kudu.TestingKuduServer.EARLIEST_TAG;

public class TestKuduWithDisabledInferSchemaConnectorTest
extends AbstractKuduWithDisabledInferSchemaConnectorTest
{
@Override
protected String getKuduServerVersion()
{
return EARLIEST_TAG;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.trino.plugin.kudu;

import static io.trino.plugin.kudu.TestingKuduServer.EARLIEST_TAG;

public class TestKuduWithEmptyInferSchemaConnectorTest
extends AbstractKuduWithEmptyInferSchemaConnectorTest
{
@Override
protected String getKuduServerVersion()
{
return EARLIEST_TAG;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.trino.plugin.kudu;

import static io.trino.plugin.kudu.TestingKuduServer.EARLIEST_TAG;

public class TestKuduWithStandardInferSchemaConnectorTest
extends AbstractKuduWithStandardInferSchemaConnectorTest
{
@Override
protected String getKuduServerVersion()
{
return EARLIEST_TAG;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ public class TestingKuduServer
implements Closeable
{
private static final String KUDU_IMAGE = "apache/kudu";
public static final String EARLIEST_TAG = "1.13.0";
public static final String LATEST_TAG = "1.15.0";

private static final Integer KUDU_MASTER_PORT = 7051;
private static final Integer KUDU_TSERVER_PORT = 7050;
private static final Integer NUMBER_OF_REPLICA = 3;
Expand All @@ -49,8 +52,7 @@ public class TestingKuduServer

public TestingKuduServer()
{
// This version should match the kudu client version
this("1.15.0");
this(LATEST_TAG);
}

/**
Expand Down