-
Notifications
You must be signed in to change notification settings - Fork 1
fix for org= always in first place #27
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
base: main
Are you sure you want to change the base?
Conversation
sc250072
left a comment
There was a problem hiding this 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove ✅ symbols in comments
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why airflow in comment
There was a problem hiding this comment.
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")) { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
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")) { |
There was a problem hiding this comment.
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"
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;|