FAQ
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

Search Discussions

  • Ning Zhang at Sep 7, 2010 at 4:39 am
    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
  • Ariel Leiva at Sep 7, 2010 at 7:44 pm
    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 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

  • Ning Zhang at Sep 7, 2010 at 9:03 pm
    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 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
  • Carl Steinbach at Sep 8, 2010 at 8:00 am
    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 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 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

  • Ariel Leiva at Sep 10, 2010 at 6:32 pm
    Thanks Carl,
    i could test ODBC driver for Hive following what you suggested as 1)

    Ariel
    On Wed, Sep 8, 2010 at 4:59 AM, Carl Steinbach wrote:

    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 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 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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categorieshive, hadoop
postedSep 4, '10 at 8:32p
activeSep 10, '10 at 6:32p
posts6
users3
websitehive.apache.org

People

Translate

site design / logo © 2022 Grokbase