GoogleCloudPlatform / GoogleCloudPlatform/professional-services-data-validator
Error when attempting to create partitions on large Teradata tables (2B+ rows)
- Dominant language
- Python
- Stars
- 524
- Forks
- 171
- Avg merge
- 5d 15h
- Merged PRs (30d)
- 4
Description
When creating partitions for a large table in a Teradata to BigQuery migration, the following error was encountered:
teradatasql.OperationalError: [Version 20.0.0.15] [Session 64925450] [Teradata Database] [Error 2616] Numeric overflow occurred during computation

DVT is failing when generating the partitions as it is trying to do count(*) before partition creation.
According to the documentation, a TD integer can only be between -2,147,483,648 and 2,147,483,647. The table in question has 2,234,011,695 rows, which is outside the Integer range(https://docs.teradata.com/r/Enterprise_IntelliFlex_VMware/SQL-Data-Types-and-Literals/Numeric-Data-Types/INTEGER-Data-Type).
Suggestion is to change the count check to cast(count(1) as BIGINT) which should resolve the error.
Contributor guide
Assessment
This issue has not been assessed yet.