DATA_READ ERROR: Failure while attempting to read from database

error while reading int8 data type from PostgreSQL database, select works fine in other sql clients like DBViz but dremio throws error, individual select works fine without the column data type int8.

Anyone faced this kind of issue before? If so could you please suggest how to resolve this?

[Error Id: 795f5e32-f85c-49f0-a9ee-841fd1f9cd67 on 05e56d08302d:31010]

(org.postgresql.util.PSQLException) Bad value for type long
org.postgresql.jdbc.PgResultSet.toLong():2860
org.postgresql.jdbc.PgResultSet.getLong():2114
org.apache.commons.dbcp2.DelegatingResultSet.getLong():218
org.apache.commons.dbcp2.DelegatingResultSet.getLong():218
com.dremio.exec.store.jdbc.JdbcRecordReader$BigIntCopier.copy():416
com.dremio.exec.store.jdbc.JdbcRecordReader.next():240
com.dremio.exec.store.CoercionReader.next():212
com.dremio.sabot.op.scan.ScanOperator.outputData():215
com.dremio.sabot.driver.SmartOp$SmartProducer.outputData():526
com.dremio.sabot.driver.StraightPipe.pump():56
com.dremio.sabot.driver.Pipeline.doPump():109
com.dremio.sabot.driver.Pipeline.pumpOnce():99
com.dremio.sabot.exec.fragment.FragmentExecutor$DoAsPumper.run():311
com.dremio.sabot.exec.fragment.FragmentExecutor$DoAsPumper.run():307
java.security.AccessController.doPrivileged():-2
javax.security.auth.Subject.doAs():422
org.apache.hadoop.security.UserGroupInformation.doAs():1836
com.dremio.sabot.exec.fragment.FragmentExecutor.run():264
com.dremio.sabot.exec.fragment.FragmentExecutor.access$1000():93
com.dremio.sabot.exec.fragment.FragmentExecutor$AsyncTaskImpl.run():619
com.dremio.sabot.task.AsyncTaskWrapper.run():103
com.dremio.sabot.task.slicing.SlicingThread.mainExecutionLoop():123
com.dremio.sabot.task.slicing.SlicingThread.run():68

Hi @paulsuk1982

This is a known bug we are soon addressing, until then select any column explicitly along with “*”. For example if you have a column named say “emp_name” in the table then try the below

select emp_name, * from <postgres_table>

Thanks
@balaji.ramaswamy

Thanks …for the update, will try the same until the fix come along…But it’s bit difficult to identify the specific column which is throwing the conversion error, we know dremio does not handle jsonb data type yet, so we are already excluding that column in our queries.

In this scenario the issue is happening for INt8 datatype column which is sequential unique number, however other int8 datatype columns works fine.