Error on querying Postgresql 11 related to timestamp values

All our datawarehouse tables contain a couple of timestamp columns and a json type column. When querying these tables in 3.1.8 or 3.1.10 on Centos 7 Linux, we get an error in the logs as below.
The same query on the same database server from Windows dremio 3.0 works.

The value the error complains about, {1}, seems to come from a different column than the timestamp columns. Perhaps Dremio or JDBC is looking at the wrong column due to skipping the json-typed column?

We already tried whether upgrading the PostgreSQL JDBC driver would help, hence the log lists version 42.2.5 instead of the provided 42.1.1.

The server log spits out:
2019-04-26 11:59:12,191 [233d2990-e984-d5eb-1403-245a31a27e00:foreman] INFO c.d.s.fabric.FabricConnectionManager - [FABRIC]: No connection active, opening new connection to
2019-04-26 11:59:12,308 [FABRIC-rpc-event-queue] INFO c.d.sabot.exec.FragmentExecutors - Received remote fragment start instruction for 233d2990-e984-d5eb-1403-245a31a27e00:0:0
2019-04-26 11:59:12,337 [FABRIC-rpc-event-queue] INFO c.d.sabot.exec.FragmentExecutors - Received remote fragment start instruction for 233d2990-e984-d5eb-1403-245a31a27e00:1:0
2019-04-26 11:59:12,715 [e1 - 233d2990-e984-d5eb-1403-245a31a27e00:frag:1:0] INFO - User Error Occurred [ErrorId: 0e99442a-0f4f-44f8-995c-c66d8271d936]
com.dremio.common.exceptions.UserException: Failure while attempting to read from database.
at com.dremio.common.exceptions.UserException$ ~[dremio-common-3.1.10-201904162146020182-adf690d.jar:3.1.10-201904162146020182-adf690d]
at [dremio-extra-plugin-jdbc-3.1.10-201904162146020182-adf690d.jar:3.1.10-201904162146020182-adf690d]
at [dremio-sabot-kernel-3.1.10-201904162146020182-adf690d.jar:3.1.10-201904162146020182-adf690d]
at com.dremio.sabot.op.scan.ScanOperator.outputData( [dremio-sabot-kernel-3.1.10-201904162146020182-adf690d.jar:3.1.10-201904162146020182-adf690d]
at com.dremio.sabot.driver.SmartOp$SmartProducer.outputData( [dremio-sabot-kernel-3.1.10-201904162146020182-adf690d.jar:3.1.10-201904162146020182-adf690d]
at com.dremio.sabot.driver.StraightPipe.pump( [dremio-sabot-kernel-3.1.10-201904162146020182-adf690d.jar:3.1.10-201904162146020182-adf690d]
at com.dremio.sabot.driver.Pipeline.doPump( [dremio-sabot-kernel-3.1.10-201904162146020182-adf690d.jar:3.1.10-201904162146020182-adf690d]
at com.dremio.sabot.driver.Pipeline.pumpOnce( [dremio-sabot-kernel-3.1.10-201904162146020182-adf690d.jar:3.1.10-201904162146020182-adf690d]
at com.dremio.sabot.exec.fragment.FragmentExecutor$ [dremio-sabot-kernel-3.1.10-201904162146020182-adf690d.jar:3.1.10-201904162146020182-adf690d]
at com.dremio.sabot.exec.fragment.FragmentExecutor$ [dremio-sabot-kernel-3.1.10-201904162146020182-adf690d.jar:3.1.10-201904162146020182-adf690d]
at Method) [na:1.8.0_201]
at [na:1.8.0_201]
at [hadoop-common-2.8.3.jar:na]
at [dremio-sabot-kernel-3.1.10-201904162146020182-adf690d.jar:3.1.10-201904162146020182-adf690d]
at com.dremio.sabot.exec.fragment.FragmentExecutor.access$1000( [dremio-sabot-kernel-3.1.10-201904162146020182-adf690d.jar:3.1.10-201904162146020182-adf690d]
at com.dremio.sabot.exec.fragment.FragmentExecutor$ [dremio-sabot-kernel-3.1.10-201904162146020182-adf690d.jar:3.1.10-201904162146020182-adf690d]
at [dremio-sabot-kernel-3.1.10-201904162146020182-adf690d.jar:3.1.10-201904162146020182-adf690d]
at com.dremio.sabot.task.slicing.SlicingThread.mainExecutionLoop( [dremio-extra-sabot-scheduler-3.1.10-201904162146020182-adf690d.jar:3.1.10-201904162146020182-adf690d]
at [dremio-extra-sabot-scheduler-3.1.10-201904162146020182-adf690d.jar:3.1.10-201904162146020182-adf690d]
Caused by: org.postgresql.util.PSQLException: Bad value for type timestamp/date/time: {1}
at org.postgresql.jdbc.TimestampUtils.parseBackendTimestamp( ~[postgresql-42.2.5.jar:42.2.5]
at org.postgresql.jdbc.TimestampUtils.toTimestamp( ~[postgresql-42.2.5.jar:42.2.5]
at org.postgresql.jdbc.TimestampUtils.toDate( ~[postgresql-42.2.5.jar:42.2.5]
at org.postgresql.jdbc.PgResultSet.getDate( ~[postgresql-42.2.5.jar:42.2.5]
at org.apache.commons.dbcp2.DelegatingResultSet.getDate( ~[commons-dbcp2-2.2.0.jar:2.2.0]
at org.apache.commons.dbcp2.DelegatingResultSet.getDate( ~[commons-dbcp2-2.2.0.jar:2.2.0]
at$DateCopier.copy( ~[dremio-extra-plugin-jdbc-3.1.10-201904162146020182-adf690d.jar:3.1.10-201904162146020182-adf690d]
at [dremio-extra-plugin-jdbc-3.1.10-201904162146020182-adf690d.jar:3.1.10-201904162146020182-adf690d]
… 17 common frames omitted
Caused by: java.lang.NumberFormatException: Timestamp has neither date nor time
at org.postgresql.jdbc.TimestampUtils.parseBackendTimestamp( ~[postgresql-42.2.5.jar:42.2.5]
… 24 common frames omitted
2019-04-26 11:59:12,772 [e0 - 233d2990-e984-d5eb-1403-245a31a27e00:frag:0:0] INFO c.d.s.e.f.FragmentStatusReporter - 233d2990-e984-d5eb-1403-245a31a27e00:0:0: State to report: CANCELLED

Hi @alban

I am able to reproduce something very similar. Would you mind sending me your profile for the failed job. I want to see what we push down into Postgres

Share A Query Profile


It does look like the query is passed 1:1 to Postgres. Perhaps this is an issue with the timezone setting of the client (Dremio)?

Profile attached (anonimized manually) (9.5 KB)

Hi @alban

It does look like the same behavior I reproduced. As we look to see how we can fix this, you can try couple of workarounds

  1. Currently we do not support the JSON column so you can try individually select the columns
  2. Recreate the Postges table with the JSON column as the last column and then select * should work


Hi guys, are there still issues with accessing Postgres tables on the newest version?
I have connected up 2 databases, both hosted on AWS, and only a few of the tables allow me to browse. The rest say “Failure while attempting to read from database”.

I managed to build a basic query across one of the failing tables, but when I open the available fields list there are a lot missing, which I assume has something to do with their “type”?

Hi @gdelaney

Do you have JSON columns?

Hi Balaji,

We do on a few tables but not all.

Also having issues access elastic clusters.



The problem is that the interface, by default, does select *. We do not have a choice in that, it happens before we can select columns to put into a user-facing table definition in Dremio.

The other option, moving the JSON columns to the end, will be difficult to implement for us and impossible to maintain; The JSON column is part of a set of default columns that our ETL process creates on creating the table (it is used to track corrections for data-quality), after which the columns from the source-table are appended. The reason for this order of operation is that it puts the default columns in a predictable position; if the source table sprouts new columns, those can only be appended to the end of the table.

Also, reordering columns requires rewriting the table. Some of our tables are several GBs in size. We’d have to do that every time a new column gets added from the source to put the JSON column at the end of the list again…

It’s not a huge problem that Dremio errors at this phase of table definition, the interface still works and these columns are not meant for users anyway, but it looks like a fairly simple to fix off-by-one error when accessing column contents after skipping over those of types that Dremio doesn’t support.


Please open a new community post for the elastic issue