Search in sources :

Example 1 with SqlExecutor

use of io.trino.testing.sql.SqlExecutor in project trino by trinodb.

the class TestMySqlTypeMapping method testUnsupportedDataType.

private void testUnsupportedDataType(String databaseDataType) {
    SqlExecutor jdbcSqlExecutor = mySqlServer::execute;
    jdbcSqlExecutor.execute(format("CREATE TABLE tpch.test_unsupported_data_type(supported_column varchar(5), unsupported_column %s)", databaseDataType));
    try {
        assertQuery("SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'tpch' AND TABLE_NAME = 'test_unsupported_data_type'", // no 'unsupported_column'
        "VALUES 'supported_column'");
    } finally {
        jdbcSqlExecutor.execute("DROP TABLE tpch.test_unsupported_data_type");
    }
}
Also used : TrinoSqlExecutor(io.trino.testing.sql.TrinoSqlExecutor) SqlExecutor(io.trino.testing.sql.SqlExecutor)

Example 2 with SqlExecutor

use of io.trino.testing.sql.SqlExecutor in project trino by trinodb.

the class TestSingleStoreTypeMapping method testUnsupportedDataType.

private void testUnsupportedDataType(String databaseDataType) {
    SqlExecutor jdbcSqlExecutor = singleStoreServer::execute;
    jdbcSqlExecutor.execute(format("CREATE TABLE tpch.test_unsupported_data_type(supported_column varchar(5), unsupported_column %s)", databaseDataType));
    try {
        assertQuery("SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'tpch' AND TABLE_NAME = 'test_unsupported_data_type'", // no 'unsupported_column'
        "VALUES 'supported_column'");
    } finally {
        jdbcSqlExecutor.execute("DROP TABLE tpch.test_unsupported_data_type");
    }
}
Also used : TrinoSqlExecutor(io.trino.testing.sql.TrinoSqlExecutor) SqlExecutor(io.trino.testing.sql.SqlExecutor)

Aggregations

SqlExecutor (io.trino.testing.sql.SqlExecutor)2 TrinoSqlExecutor (io.trino.testing.sql.TrinoSqlExecutor)2