DataType Error when connecting PostgreSQL Source: Unsupported precision for data type
Operating System (Polypheny-DB)
Linux
Polypheny-DB Version
v.0.9.0
Affected Areas
DB, UI
Browser
No response
Client Operating System
SLES 15 SP4
Bug Description
When connecting a PostgreSQL Data Source table containing a column with type timestamp without timezone
The creation fails with the following error:
Caused by: java.lang.RuntimeException: Unsupported precision for data type timestamp: 6
When looking at the source table the issue revolves around a column with the type: timestamp without timezone
If we were to remove this column the connection and consequently the creation of the source is successful.
Reproduction Steps
- Create a PSQL table containing a column with type:
timestamp without timezone. - Within Polypheny add a new PostgreSQL Source Adapter on that specific table
- Within the service log under linux
journalctl -u polypheny.serviceobserver an error similiar to:
Caused by: java.lang.RuntimeException: Unsupported precision for data type timestamp
Expected Behavior
Adapt and correctly translate the remote type to Polypheny Timestamp Type. Maybe even always assume UTC or convert it to string? Because a timestamp without timezone is meaningless anyway
Also the failure message could be improved instead of "Adapter could not be deployed" give a more insightful response without the need to consult the error log.
Relevant Log Output
Caused by: java.lang.RuntimeException: Unsupported precision for data type timestamp: 6
Jun 05 10:32:34 myVMInstance Polypheny[25395]: at org.polypheny.db.adapter.jdbc.sources.AbstractJdbcSource.getExportedColumns(AbstractJdbcSource.java:251) ~[?:?]
Jun 05 10:32:34 myVMInstance Polypheny[25395]: at org.polypheny.db.ddl.DdlManagerImpl.addAdapter(DdlManagerImpl.java:239) ~[Polypheny.jar:0.9.0]
Jun 05 10:32:34 myVMInstance Polypheny[25395]: at org.polypheny.db.sql.language.ddl.SqlAlterAdaptersAdd.execute(SqlAlterAdaptersAdd.java:98) ~[?:?]
Jun 05 10:32:34 myVMInstance Polypheny[25395]: at org.polypheny.db.processing.Processor.getResult(Processor.java:69) ~[Polypheny.jar:0.9.0]
Jun 05 10:32:34 myVMInstance Polypheny[25395]: at org.polypheny.db.processing.Processor.prepareDdl(Processor.java:53) ~[Polypheny.jar:0.9.0]
Jun 05 10:32:34 myVMInstance Polypheny[25395]: at org.polypheny.db.webui.Crud.processQuery(Crud.java:3425) ~[Polypheny.jar:0.9.0]
Jun 05 10:32:34 myVMInstance Polypheny[25395]: at org.polypheny.db.webui.Crud.executeSqlUpdate(Crud.java:3454) ~[Polypheny.jar:0.9.0]
Jun 05 10:32:34 myVMInstance Polypheny[25395]: ... 55 more