pacman82/odbc2parquet

Attempting to list drivers using odbc2parquet 0.6.2.7 on Oracle Linux 7.8 after compiling it on the same os fails with State: S1009, Native error: 0, Message: [unixODBC][Driver Manager]Invalid attribute value

Closed this issue · 12 comments

[svrvdef@tmwenqtrn utils]$ ./odbc2parquet
odbc2parquet 0.6.27
Query an ODBC data source at store the result in a Parquet file

USAGE:
odbc2parquet [OPTIONS]

OPTIONS:
-h, --help Print help information
-q, --quiet Only print errors to standard error stream. Supresses warnings and all other
log levels independent of the verbose mode
-v, --verbose Verbose mode (-v, -vv, -vvv, etc)
-V, --version Print version information

SUBCOMMANDS:
completions Generate shell completions
help Print this message or the help of the given subcommand(s)
insert Read the content of a parquet and insert it into a table
list-data-sources List preconfigured data sources. Useful to find data source name to
connect to database
list-drivers List available drivers and their attributes
query Query a data source and write the result as parquet
[svrvdef@tmwenqtrn utils]$ ./odbc2parquet list-drivers
2022-03-24T16:18:54-07:00 - WARN - State: S1009, Native error: 0, Message: [unixODBC][Driver Manager]Invalid attribute value
Error: ODBC emitted an error calling 'SQLSetEnvAttr':
State: S1009, Native error: 0, Message: [unixODBC][Driver Manager]Invalid attribute value

What version of Unix odbc is installed?

Hello @chrisfw ,

so now I've found a bit of time to write a more elaborate answer. Thanks for opening the issue. To help our understanding let's translate the error message, which you kindly provided.

ODBC emitted an error calling 'SQLSetEnvAttr':
State: S1009, Native error: 0, Message: [unixODBC][Driver Manager]Invalid attribute value

This error was emitted calling SQLSetEnvAttr which is only called in one place if executing odbc2parquet: Then setting the ODBC API version number. At the beginning of its lifecycle any ODBC application declares which version of the ODBC standard it wants to use to communicate to the driver manager (unixODBC).

In that context the Invalid attribute value is the version number. odbc2parquet currently utilizes the version 3.80 of the ODBC standard. Note: This is the version of the ODBC standard not the version of the driver manager odbc2parquet expects.

The error indicates, that your version of the driver manager does not even know that this version exists. Which leaves me to belive that it might be an outdated version of unixODBC.

Checking the changelog of unixODBC the ODBC 3.80 is first mentioned for the version unixODBC 2.3.0 which has been released 2010. See: http://www.unixodbc.org/

In terms of this tool I find the error message you received less than ideal. Best to emit a better error in the upstream odbc-api if setting the desired ODBC version fails. This however won't solve your problem. It would still fail, just with a nicer error. Yet an update of unixODBC packet might.

Please let me know if any of this has been helpful, and if the diagnose turned out to be correct or not.

Cheers, Markus

Just released odbc2parquet 0.6.28 which is going to emit a better error message in your situation. Still curious on what version of unixODBC you are running though.

Cheers, Markus

Hi Chris,

would you mind upgrading to a newer version, and tell me how it goes. FYI: In case your package manager does not provide the newest version, building unixODBC from source is pretty straight forward:

1. copy the unixODBC-2.3.9.tar.gz file somewhere you can create files and directories
2. gunzip unixODBC*.tar.gz
3. tar xvf unixODBC*.tar
4. `./configure`
5. `make`
6. `make install`

I am not sure, at what version unixODBC officially supports ODBC 3.80, but the latest version does for sure. So updating it is something I find worth trying.

Cheers, Markus

Hi Chris,

looking forward to it. This might become relevant for me, too.

Cheers, Markus

Hi Chris,

Thanks for the feedback. Closing the issue.

Cheers, Markus