Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add port number as a DBS_PORT parameter in Teradata JDBC Connection String #2452

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Jithendar12
Copy link
Contributor

@Jithendar12 Jithendar12 commented Dec 2, 2024

Issue #, if available:
The Teradata JDBC connection string requires a specific format to include the port number.
Example URL:
jdbc:teradata://host/TMODE=ANSI,CHARSET=UTF8,DATABASE=TEST,DBS_PORT=1025,user=dummy,password=dummy

Previously, the port was included in the connection string as host:port, which was not compatible with the Teradata JDBC driver

Description of changes:
Overridden the connectionPropertiesToEnvironment method to include the port number as a DBS_PORT parameter.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@Jithendar12 Jithendar12 marked this pull request as ready for review December 2, 2024 11:36
@Jithendar12 Jithendar12 force-pushed the panama-sdkv2-gdcv2-trianz branch from 4761d30 to 1979de0 Compare December 3, 2024 14:49
@Jithendar12 Jithendar12 changed the base branch from panama-sdkv2-gdcv2 to master December 20, 2024 05:24
@Jithendar12 Jithendar12 force-pushed the panama-sdkv2-gdcv2-trianz branch from 1979de0 to c3d9cb3 Compare December 20, 2024 05:30
@Jithendar12 Jithendar12 force-pushed the panama-sdkv2-gdcv2-trianz branch 2 times, most recently from e3ddbfd to 910f5c5 Compare January 6, 2025 14:43
@Jithendar12 Jithendar12 changed the title Remove Port Number from Teradata Connection String Add port number as a DBS_PORT parameter in Teradata JDBC Connection String Jan 6, 2025
@Jithendar12 Jithendar12 force-pushed the panama-sdkv2-gdcv2-trianz branch from 910f5c5 to 5d62c49 Compare January 9, 2025 07:51
@AbdulR3hman AbdulR3hman force-pushed the panama-sdkv2-gdcv2-trianz branch from 5d62c49 to ebf8eb4 Compare January 10, 2025 18:32
{
HashMap<String, String> environment = new HashMap<>();
// Default port for teradata is 1025
String port = connectionProperties.getOrDefault(PORT, "1025");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this to the Teradata constants; not here.


// Construct the JDBC connection string and include the port as a DBS_PORT parameter
String connectionString = getConnectionStringPrefix(connectionProperties) + connectionProperties.get(HOST)
+ getDatabase(connectionProperties) + ",DBS_PORT=" + port + getJdbcParameters(connectionProperties);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is assuming a new change; will this break existing customers? what exactly promoted this change? I want to make sure this is backward compatible; i.e.; existing customers who are upgrading won't have their environments broken.


public class TeradataEnvironmentProperties extends JdbcEnvironmentProperties
{
@Override
public Map<String, String> connectionPropertiesToEnvironment(Map<String, String> connectionProperties)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add a unit test once questions below are answered.

Copy link

codecov bot commented Jan 10, 2025

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 61.15%. Comparing base (7b40bf4) to head (ebf8eb4).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
...ectors/teradata/TeradataEnvironmentProperties.java 0.00% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2452      +/-   ##
============================================
+ Coverage     61.09%   61.15%   +0.06%     
- Complexity     3738     3751      +13     
============================================
  Files           576      577       +1     
  Lines         21348    21441      +93     
  Branches       2654     2661       +7     
============================================
+ Hits          13043    13113      +70     
- Misses         7037     7057      +20     
- Partials       1268     1271       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants