Hi Ariel, Here are a couple more things to try:
1) Force libhiveodbc.so to be loaded first by setting the LD_PRELOAD environment library: % LD_PRELOAD=/usr/local/unixODBC/lib/libodbchive.so isql -v Hive It turns out that SQLAllocEnv is defined in both libodbchive.so *and* libodbc.so. I have noticed that if libodbc.so gets loaded first its definition of SQLAllocEnv tends to stick, blocking the later loading of the same symbols defined in libodbchive.so. Setting LD_PRELOAD to point to the hive odbc library is a convenient work around for this problem. 2) Set the LD_DEBUG environment variable and run isql: % LD_DEBUG=files isql -v Hive Setting this variable causes the dl* functions to dump logging information about what they are doing. Setting it to "files" will cause the dl* functions to print out the names of files as they are loaded, as well as information about any unresolved symbols. Hope this helps. Carl On Tue, Sep 7, 2010 at 2:05 PM, Ning Zhang <nzh...@facebook.com> wrote: > Something you can check out are: > - Did you compiled and deployed your code in different environment > (Linux/C compier version)? If so there might incompatibility issues in the > kernel/C .so files > - Can you check 'ldd isql' and see which .so files it loads? Particularly > libodbc.so should be the one coming with unixODBC. If you installed other > ODBC driver manager and their LD paths are before unixODBC's, isql may got > linked to the correct .so file. In addition, you can 'ldd' libodbchive.so > etc. to see if there are missing dependent .so files as well. > > On Sep 7, 2010, at 12:44 PM, Ariel Leiva wrote: > > All three .so files can be found in LD_LIBRARY_PATH and i am still getting > the same error. Thanks for your suggestion. > > On Tue, Sep 7, 2010 at 1:41 AM, Ning Zhang <nzh...@facebook.com> wrote: > >> It looks like isql cannot load libodbchive.so. Please make sure that all >> three .so files libodbchive.so, libhiveclient.so, and libthrift.so can be >> found in LD_LIBRARY_PATH. >> >> >> On Sep 4, 2010, at 1:31 PM, Ariel Leiva wrote: >> >> Hi, i built Hive odbc driver following >> http://wiki.apache.org/hadoop/Hive/HiveODBC and wanted to test it with >> isql, but i get the following error: >> >> [ISQL]ERROR: Could not SQLAllocEnv >> >> I set LD_LIBRARY_PATH so libhiveclient.so can be found correctly. >> I also tried, >> dltest libodbchive.so SQLAllocEnv which succeeds with >> dltest libodbchive.so SQLAllocEnv >> SUCCESS: Loaded libodbchive.so >> SUCCESS: Found SQLAllocEnv >> >> Location of odbc.ini in my system is /usr/local/unixODBC/etc/odbc.ini and >> its content is >> [Hive] >> Driver = /usr/local/unixODBC/lib/libodbchive.so >> Description = Hive Driver v1 >> DATABASE = default >> HOST = localhost >> PORT = 10000 >> FRAMED = 0 >> >> Ouput of odbcinst -j is >> unixODBC 2.2.14 >> DRIVERS............: /usr/local/unixODBC/etc/odbcinst.ini >> SYSTEM DATA SOURCES: /usr/local/unixODBC/etc/odbc.ini >> FILE DATA SOURCES..: /usr/local/unixODBC/etc/ODBCDataSources >> USER DATA SOURCES..: /root/.odbc.ini >> SQLULEN Size.......: 4 >> SQLLEN Size........: 4 >> SQLSETPOSIROW Size.: 2 >> >> And output of odbcinst -q -s -n Hive is: >> [Hive] >> Driver=/usr/local/unixODBC/lib/libodbchive.so >> Description=Hive Driver v1 >> DATABASE=default >> HOST=localhost >> PORT=10000 >> FRAMED=0 >> >> Can anybody help me with this error? >> Thanks in advance >> Ariel >> >> >> > >