-
Notifications
You must be signed in to change notification settings - Fork 121
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
fix: Update Teradata rtrim() to account for tabs and other whitespace #1273
Conversation
/gcbrun |
Hi, I suggest adding this to our test suite as follows:
This confirms that RTRIM on the Teradata end strips the white space characters at the end before comparison with BQ. Change this line to
This confirms that RTRIM on BigQuery removes the whitespace characters prior to comparison with other engines. We could do this for other engines - but this is a good start for Teradata and BigQuery. Thanks. Sundar Mudupalli |
Remember that dvt_core_types is used for column validation testing (and perhaps comparison fields too), we need to be sure we don't break those tests. Therefore we would need to add the extra characters across all engines because they all get compared to BigQuery, which is no big deal, just pointing it out. |
We already have a table in TD for testing CHAR PKs with |
Neil - you are right. In column validation, we use the string length for min, max and sum, so it can create an issue - especially if the dvt_core_types for other databases are not updated. Between Teradata and BQ, the min/max/sum may remain the same - though I had not considered that when I first proposed this. Thank you. Sundar Mudupalli |
@sundar-mudupalli-work I added extra tabs and whitespace to our existing char_id table which tests the use of |
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.
LGTM!
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.
Nice. You found a way to work around character sets without the ugly hex codes!
Closes #1272
This updates the default
RTRIM(column, " ")
for Teradata so that it also accounts for tabs, newlines, and other whitespace characters.