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

postgres connector for prestodb not recognizing UUIDs #10951

Open
apatnaik14 opened this issue Jun 29, 2018 · 1 comment
Open

postgres connector for prestodb not recognizing UUIDs #10951

apatnaik14 opened this issue Jun 29, 2018 · 1 comment
Labels

Comments

@apatnaik14
Copy link

Hi Team,

My underlying database is that of postgres and a majority of my primary keys are UUIDs. When I access my database from my presto setup, I am unable to see the UUID columns in the describe or perform joins or queries on them.

I feel this is a known issue and I am sorry for raising a duplicate ticket if already one exists. I was hoping to see if this is something that will be added to the connector/prestodb later on in future releases.

Workaround option I thought of -

Creating a VIEW object in postgres with typecast of UUIDs to 'varchar'. But as always its best not to join on varchars, so I'd like to avoid the approach if possible.

Please feel free to let me know if I am missing anything. Please find below the details of presto I am using

presto-server-0.157
Postgres Version - "PostgreSQL 9.6.9 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.2.0-8ubuntu3.2) 7.2.0, 64-bit"

Thanks,
A

@findepi
Copy link
Contributor

findepi commented Jul 8, 2018

Creating a VIEW object in postgres with typecast of UUIDs to 'varchar'. But as always its best not to join on varchars, so I'd like to avoid the approach if possible.

The workaround isn't as bad as it sounds.
Postgres UUIDs will be modelled probably as varchars anyway, since Presto doesn't have dedicated UUID type.

If you'd like to implement this

  • the types are mapped in BaseJdbcClient.toPrestoType (needs postgres-specific override)
  • the tests are in TestPostgreSqlTypeMapping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants