Search in sources :

Example 1 with JdbcRecordHandler

use of com.amazonaws.athena.connectors.jdbc.manager.JdbcRecordHandler in project aws-athena-query-federation by awslabs.

the class ImpalaMuxRecordHandlerTest method maxCatalogTest.

@Test
public void maxCatalogTest() {
    Map<String, JdbcRecordHandler> recorddataHandlersMap = new HashMap<String, JdbcRecordHandler>();
    for (int jdbcHandlerCount = 0; jdbcHandlerCount <= 100; jdbcHandlerCount++) {
        recorddataHandlersMap.put("recordImpala" + jdbcHandlerCount, this.impalaRecordHandler);
    }
    DatabaseConnectionConfig databaseConnectionConfig = new DatabaseConnectionConfig("testCatalog1", ImpalaConstants.IMPALA_NAME, "impala://jdbc:impala://54.89.6.2:10000/authena;AuthMech=3;${testSecret}", "testSecret");
    try {
        new ImpalaMuxRecordHandler(this.amazonS3, this.secretsManager, this.athena, this.jdbcConnectionFactory, databaseConnectionConfig, recorddataHandlersMap);
    } catch (Exception e) {
        e.getMessage();
        Assert.assertTrue(e.getMessage().contains("Max 100 catalogs supported in multiplexer."));
    }
}
Also used : HashMap(java.util.HashMap) DatabaseConnectionConfig(com.amazonaws.athena.connectors.jdbc.connection.DatabaseConnectionConfig) JdbcRecordHandler(com.amazonaws.athena.connectors.jdbc.manager.JdbcRecordHandler) SQLException(java.sql.SQLException) Test(org.junit.Test)

Example 2 with JdbcRecordHandler

use of com.amazonaws.athena.connectors.jdbc.manager.JdbcRecordHandler in project aws-athena-query-federation by awslabs.

the class HiveMuxRecordHandlerTest method maxCatalogTest.

@Test
public void maxCatalogTest() {
    Map<String, JdbcRecordHandler> recorddataHandlersMap = new HashMap<String, JdbcRecordHandler>();
    for (int jdbcHandlerCount = 0; jdbcHandlerCount <= 100; jdbcHandlerCount++) {
        recorddataHandlersMap.put("recordHive" + jdbcHandlerCount, this.hiveRecordHandler);
    }
    DatabaseConnectionConfig databaseConnectionConfig = new DatabaseConnectionConfig("testCatalog1", HiveConstants.HIVE_NAME, "hive2://jdbc:hive2://54.89.6.2:10000/authena;AuthMech=3;${testSecret}", "testSecret");
    try {
        new HiveMuxRecordHandler(this.amazonS3, this.secretsManager, this.athena, this.jdbcConnectionFactory, databaseConnectionConfig, recorddataHandlersMap);
    } catch (Exception e) {
        e.getMessage();
        Assert.assertTrue(e.getMessage().contains("Max 100 catalogs supported in multiplexer."));
    }
}
Also used : HashMap(java.util.HashMap) DatabaseConnectionConfig(com.amazonaws.athena.connectors.jdbc.connection.DatabaseConnectionConfig) JdbcRecordHandler(com.amazonaws.athena.connectors.jdbc.manager.JdbcRecordHandler) SQLException(java.sql.SQLException) Test(org.junit.Test)

Example 3 with JdbcRecordHandler

use of com.amazonaws.athena.connectors.jdbc.manager.JdbcRecordHandler in project aws-athena-query-federation by awslabs.

the class HiveMuxRecordHandlerTest method maxCatalogTest.

@Test
public void maxCatalogTest() {
    Map<String, JdbcRecordHandler> recorddataHandlersMap = new HashMap<String, JdbcRecordHandler>();
    for (int jdbcHandlerCount = 0; jdbcHandlerCount <= 100; jdbcHandlerCount++) {
        recorddataHandlersMap.put("recordHive" + jdbcHandlerCount, this.hiveRecordHandler);
    }
    DatabaseConnectionConfig databaseConnectionConfig = new DatabaseConnectionConfig("testCatalog1", HiveConstants.HIVE_NAME, "hive2://jdbc:hive2://54.89.6.2:10000/authena;AuthMech=3;${testSecret}", "testSecret");
    try {
        new HiveMuxRecordHandler(this.amazonS3, this.secretsManager, this.athena, this.jdbcConnectionFactory, databaseConnectionConfig, recorddataHandlersMap);
    } catch (Exception e) {
        e.getMessage();
        Assert.assertTrue(e.getMessage().contains("Max 100 catalogs supported in multiplexer."));
    }
}
Also used : HashMap(java.util.HashMap) DatabaseConnectionConfig(com.amazonaws.athena.connectors.jdbc.connection.DatabaseConnectionConfig) JdbcRecordHandler(com.amazonaws.athena.connectors.jdbc.manager.JdbcRecordHandler) SQLException(java.sql.SQLException) Test(org.junit.Test)

Aggregations

DatabaseConnectionConfig (com.amazonaws.athena.connectors.jdbc.connection.DatabaseConnectionConfig)3 JdbcRecordHandler (com.amazonaws.athena.connectors.jdbc.manager.JdbcRecordHandler)3 SQLException (java.sql.SQLException)3 HashMap (java.util.HashMap)3 Test (org.junit.Test)3