trinodb / trino

Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)
https://trino.io
Apache License 2.0
10.19k stars 2.94k forks source link

Duplicate Entries for Integer Data Type in system.jdbc.types Table #22733

Open nil1729 opened 1 month ago

nil1729 commented 1 month ago

Issue Description:

When querying the system.jdbc.types table in Trino, the data type INTEGER appears twice. This seems to be caused by the aliases INT and INTEGER both being recognized as the same type. Ideally, the table should only return a single canonical entry for the integer data type.

Steps to Reproduce:

Execute a query on the system.jdbc.types table.

image

cc: @mosabua

mosabua commented 1 month ago

Discussed in https://trinodb.slack.com/archives/C0305TQ05KL/p1721310493381869 and confirmed by @martint to be a bug.

mosabua commented 1 month ago

source code where it is added:

https://github.com/trinodb/trino/blob/47e52cbc7cfbd649e912fd4d0b43b03dbe6279f4/core/trino-main/src/main/java/io/trino/metadata/TypeRegistry.java#L133

We probably need to avoid adding it for the types table or introduce some sort of alias concept