fix: Protect column and row validation calculated column names from Oracle 30 character identifier limit #749
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This protects all engines not just Oracle 12.1 and below. It's just that Oracle 12.1 and below have a 30 character limit which we almost always cross for row validation. Other engines have a 128 character identifier limit and therefore are less likely to be breached.
This PR introduces the following change:
Example of column validation SQL from new logic:
Note that:
length__dvt_calc_col_4
is introduced at depth 1 because the length oflength__col_string_long_1234567890
would cross 30 charactersmax__
alias is then applied to the length column at depth 0:max__length__dvt_calc_col_4
max__
alias is applied to the decimal column at depth 0 because the length ofmax__col_dec_long_123456789012345
would cross 30 charactersmax__id
is unaffected because it remains below 30 charactersThe same logic would be seen in a row validation too but more functions are applied so we're more likely to see
dvt_calc_col
columns. It's worth pointing out that this is only visible in the SQL statement, the end report still uses proper column names.