Skip to content

Conversation

@MT255026
Copy link
Collaborator

QueryBand |
-------------------------------------------------+
=S> org=teradata-internal-telem;appname=fivetran;|
=S> org=teradata-internal-telem;appname=fivetran;|
|
=S> org=teradata-internal-telem;appname=fivetran;|
=S> org=teradata-internal-telem;appname=fivetran;|

@MT255026 MT255026 requested review from sc250072 and vs255034 and removed request for vs255034 January 20, 2026 16:14
Copy link
Collaborator

@sc250072 sc250072 left a comment

Choose a reason for hiding this comment

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

Couple of review comments addressed

if (!queryBandMap.containsKey("org")) {
queryBandMap.put("org", "teradata-internal-telem;");
}
// ✅ Always put org FIRST
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove ✅ symbols in comments

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed


// Check if "appname" key exists
if (queryBandMap.containsKey("appname")) {
// Check if "airflow" exists in the value of "appname" key
Copy link
Collaborator

Choose a reason for hiding this comment

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

why airflow in comment

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Got this code from the airflow. Anyway, removed now.

if (queryBandMap.containsKey("appname")) {
// Check if "airflow" exists in the value of "appname" key
String appnameValue = queryBandMap.get("appname").toLowerCase();
if (!appnameValue.contains("fivetran")) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

contains is case sensitive. this method will provide false for Fivetran or FIVETRAN in appname. Use toLowercase to handle all scenarios

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Addressed

}

// Reconstruct the queryBand string from the map
// ✅ Add remaining keys (if any), preserving original behavior
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove symbols in all comments

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed

}

@Test
void orgAtEnd_shouldBeMovedToFirst() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add tests for null, empty, duplicate keys and special values like contains "=" cases.

if (!appnameValue.contains("fivetran")) {
queryBandMap.put("appname", queryBandMap.get("appname") + "_fivetran;");
// ✅ Handle appname SECOND
if (parsed.containsKey("appname")) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

containsKey is also case sensitive. It wont be true for words "APPNAME", "Appname"

@MT255026 MT255026 requested a review from vs255034 January 21, 2026 08:17
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.

3 participants