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

feat: Control Teradata decimal format when cast to string #1138

Merged
merged 3 commits into from
May 21, 2024

Conversation

nj1973
Copy link
Contributor

@nj1973 nj1973 commented May 20, 2024

This PR adds a TO_CHAR format to Teradata NUMBERs/DECIMALs to work around two inconsistencies with other engines.

  1. SELECT CAST(CAST(7 AS DECIMAL(5,2)) AS VARCHAR(64));
    '7.00'
  2. SELECT CAST(CAST(-0.7 AS DECIMAL(5,2)) AS VARCHAR(64));
    '-.70'

After merging this PR we get these literals from the examples above:

  1. '7'
  2. '-0.7'

@nj1973 nj1973 requested a review from a team as a code owner May 20, 2024 16:52
@nj1973 nj1973 linked an issue May 20, 2024 that may be closed by this pull request
@nj1973
Copy link
Contributor Author

nj1973 commented May 20, 2024

/gcbrun

Copy link
Collaborator

@nehanene15 nehanene15 left a comment

Choose a reason for hiding this comment

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

LGTM!

@nj1973
Copy link
Contributor Author

nj1973 commented May 21, 2024

/gcbrun

@nj1973 nj1973 merged commit e68e2a6 into develop May 21, 2024
5 checks passed
@nj1973 nj1973 deleted the issue1134-teradata-decimal-precision-casting branch May 21, 2024 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Row validation failing for TD DECIMAL(15,2) and BQ NUMERIC(15,2)
2 participants