- 
                Notifications
    
You must be signed in to change notification settings  - Fork 4
 
Closed
Description
I am trying to use the driver together with PrestoDB. Presto needs to analyze the metadata returned by ML jdbc driver and I encountered few issues, this would be the first of them.
The metadata for VARCHAR set the columnSize to value -4 - I think this is happening because:
- PgDatabaseMetaData line 1815: always returns 0 as attypemod
 - PgDatabaseMetaData line 1837: uses this value as typeMod
 - PgDatabaseMetaData line 1854: uses typeMod (set to 0) to determine length of this varchar using class TypeInfoCache
 - TypeInfoCache line 623: is probably left unmodified from Postgres, not expecting 0, returns 0-4=-4 instead of a real value or _unknownLength that would probably behave better.
 - Presto fails with some assertions when analyzing the query results, it does not know what to do with VARCHAR of length -4
 
To address this issue I would suggest either
- set the columnSize to real length of varchar, but I assume it is not possible with ODBC views in ML?
 - set the columnSize to _unknownLength for varchars
 
I can create a pull request for the latter case for PgDatabaseMetaData class if you support this solution
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working