Skip to main content
PauloNeves
Gold ⭐️
July 5, 2021
Question

Hive ODBC fails to list all tables and returns errors: DBCException: SQL Error [S1090]: [Microsoft][ODBC Driver Manager]

I'm connecting to Hive using Cloudera's ODBC driver version 2.6.9 and I'm getting a weird behavior that ruins the user experience. Any help to solve or debug this problem would be greatly appreciated.

 

I'm using DBeaver to connect to it. All my databases just display a few of it's tables. Here is an example. When I open DBeaver, The dabase just shows the table `localizacao`:

 

PauloNeves_0-1625509834632.png

 

This database has 3 tables. If I run the command show tables from raw_aneel, DBeaver interface will display:

 

PauloNeves_1-1625509891889.png

 

The error message in english would be:




    org.jkiss.dbeaver.model.exec.DBCException: SQL Error [S1090]: [Microsoft][ODBC Driver Manager] Invalid string or buffer length

 

 

Here is the complete stack trace displayed in the Error Log. The error message above is in Brazilian Portuguese:

 

org.jkiss.dbeaver.model.exec.DBCException: SQL Error [S1090]: [Microsoft][ODBC Driver Manager] Comprimento inválido de cadeia de caracteres ou de buffer
at org.jkiss.dbeaver.model.impl.jdbc.data.handlers.JDBCAbstractValueHandler.fetchValueObject(JDBCAbstractValueHandler.java:55)
at org.jkiss.dbeaver.ui.controls.resultset.ResultSetDataReceiver.fetchRow(ResultSetDataReceiver.java:125)
at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.fetchQueryData(SQLQueryJob.java:718)
at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.executeStatement(SQLQueryJob.java:541)
at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.lambda$0(SQLQueryJob.java:441)
at org.jkiss.dbeaver.model.exec.DBExecUtils.tryExecuteRecover(DBExecUtils.java:171)
at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.executeSingleQuery(SQLQueryJob.java:428)
at org.jkiss.dbeaver.ui.editors.sql.execute.SQLQueryJob.extractData(SQLQueryJob.java:813)
at org.jkiss.dbeaver.ui.editors.sql.SQLEditor$QueryResultsContainer.readData(SQLEditor.java:3280)
at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.lambda$0(ResultSetJobDataRead.java:118)
at org.jkiss.dbeaver.model.exec.DBExecUtils.tryExecuteRecover(DBExecUtils.java:171)
at org.jkiss.dbeaver.ui.controls.resultset.ResultSetJobDataRead.run(ResultSetJobDataRead.java:116)
at org.jkiss.dbeaver.ui.controls.resultset.ResultSetViewer$ResultSetDataPumpJob.run(ResultSetViewer.java:4624)
at org.jkiss.dbeaver.model.runtime.AbstractJob.run(AbstractJob.java:105)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.sql.SQLException: [Microsoft][ODBC Driver Manager] Comprimento inválido de cadeia de caracteres ou de buffer
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6964)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7121)
at sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(JdbcOdbc.java:3914)
at sun.jdbc.odbc.JdbcOdbcResultSet.getDataString(JdbcOdbcResultSet.java:5697)
at sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:353)
at sun.jdbc.odbc.JdbcOdbcResultSet.getObject(JdbcOdbcResultSet.java:1677)
at org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCResultSetImpl.getObject(JDBCResultSetImpl.java:627)
at org.jkiss.dbeaver.model.impl.jdbc.data.handlers.JDBCStringValueHandler.fetchColumnValue(JDBCStringValueHandler.java:52)
at org.jkiss.dbeaver.model.impl.jdbc.data.handlers.JDBCAbstractValueHandler.fetchValueObject(JDBCAbstractValueHandler.java:49)
... 14 more

Before this stack trace there is a message `Can't read column 'tab_name' value`:

PauloNeves_2-1625510213845.png

 

Any Idea how to debug this?

6 replies

PauloNeves
Gold ⭐️
July 5, 2021

Weird. If I select a table some of the values come with the S1090 error:

 

PauloNeves_0-1625514633196.png

same query above return some valid values:

PauloNeves_1-1625514670417.png

 

But if I wait some minutes and try the query again. It works!

PauloNeves_2-1625514720882.png

Should I try some driver configuration?

 

Translate
asish
Gold ⭐️⭐️⭐️
Gold ⭐️⭐️⭐️
July 6, 2021

Please provide driver DEBUG

 

  1. To enable logging in the driver please modify the odbc.ini file and under the [Driver] section set LogLevel to 6 and LogPath to point to a writeable directory where you would like to driver to create the log files in. For example:
    [Driver]
    LogLevel=6
    LogPath=/tmp

 

Translate
PauloNeves
Gold ⭐️
July 6, 2021
Thanks, I'm trying to do it. I believe it is the file

C:\Windows\ODBC.INI

and that I must add these lines at the end of it:

[Driver]
LogLevel=6
LogPath=/tmp

I don't have write permission to this file, but I'll ask someone to do it.
Translate
PauloNeves
Gold ⭐️
August 15, 2022

Te problem improved upgrading the driver version. It still persists, but is rarer.

Translate