From 1979de02b2efd8c89c06cda30a7c8a7bdb706c1c Mon Sep 17 00:00:00 2001 From: Jithendar12 Date: Mon, 2 Dec 2024 15:54:11 +0530 Subject: [PATCH] Remove port number from teradata connection string --- .../teradata/TeradataEnvironmentProperties.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/athena-teradata/src/main/java/com/amazonaws/athena/connectors/teradata/TeradataEnvironmentProperties.java b/athena-teradata/src/main/java/com/amazonaws/athena/connectors/teradata/TeradataEnvironmentProperties.java index 0b41bbcb0f..ba7eee3c8e 100644 --- a/athena-teradata/src/main/java/com/amazonaws/athena/connectors/teradata/TeradataEnvironmentProperties.java +++ b/athena-teradata/src/main/java/com/amazonaws/athena/connectors/teradata/TeradataEnvironmentProperties.java @@ -21,12 +21,28 @@ import com.amazonaws.athena.connectors.jdbc.JdbcEnvironmentProperties; +import java.util.HashMap; import java.util.Map; import static com.amazonaws.athena.connector.lambda.connection.EnvironmentConstants.DATABASE; +import static com.amazonaws.athena.connector.lambda.connection.EnvironmentConstants.DEFAULT; +import static com.amazonaws.athena.connector.lambda.connection.EnvironmentConstants.HOST; public class TeradataEnvironmentProperties extends JdbcEnvironmentProperties { + @Override + public Map connectionPropertiesToEnvironment(Map connectionProperties) + { + HashMap environment = new HashMap<>(); + + // construct jdbc string without port number + String connectionString = getConnectionStringPrefix(connectionProperties) + connectionProperties.get(HOST) + + getDatabase(connectionProperties) + getJdbcParameters(connectionProperties); + + environment.put(DEFAULT, connectionString); + return environment; + } + @Override protected String getConnectionStringPrefix(Map connectionProperties) {