GoogleCloudPlatform / professional-services-data-validator

Utility to compare data between homogeneous or heterogeneous environments to ensure source and target tables match
Apache License 2.0
399 stars 114 forks source link

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

Closed nj1973 closed 4 months ago

nj1973 commented 4 months ago

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 commented 4 months ago

/gcbrun

nj1973 commented 4 months ago

/gcbrun