Hi Vaibhav,

ror output when i run isql hive
>
> [-----]SQL_SUCCESS
> [-----]hEnv = $09BF20A0 phDbc = $0804E2FC
> [-----]SQL_SUCCESS
> [ISQL]ERROR: Could not SQLConnect
>

Did you remember to start the HiveServer process?

Do you have the driver configured to use the right IP
address and port number for the HiveServer process?


> I tried following commands also--
>
> export
>
> LD_LIBRARY_PATH=/usr/local/lib/libodbchive.so:/usr/local/lib/libhiveclient.so:/usr/local/lib/libthrift.so
>

LD_LIBRARY_PATH should contain a list of directories, not files, e.g:

export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

export LD_PRELOAD=/usr/local/lib/libodbchive.so
>

This looks OK, but did you verify that /usr/local/lib/libodbchive.so
actually exists?


> I think i am missing something very important.
>
> Do i need to copy files in /usr/local/lib/ to /lib ?
>

No, don't do this. In fact, when you're experimenting with new software I'd
recommend that you try to avoid altering the contents of system directories
like /usr/local, /lib, etc, since this can cause hard to find problems weeks
or months later.

One good way to keep things sane (and what I recommend you try doing now)
is to create a subdirectory in your home directory (e.g. $HOME/local) and
install
all of your test software there. In other words, build unixODBC again, but
this
time specify that you want the software installed to $HOME/local by running
configure with --prefix=$HOME/local

You'll end up with bin, lib and include directories under $HOME/local which
contain
the unixODBC driver libs along with the isql executable and various header
files.
You will then need to update some of your environment variables as follows:

# Make sure we find isql in ~/local/bin first
export PATH=~/local/bin:$PATH

# Make sure we use libodbchive.so in ~/local/lib
export LD_LIBRARY_PATH=~/local/lib:$LD_LIBRARY_PATH

# Load ~/local/lib/libodbchive.so before loading anything else.
export LD_PRELOAD=~/local/lib/libodbchive.so

Remember that these environment variable settings are specific to the
task at hand, so you probably don't want to add them to login
configuration files.

As a final sanity check please use ldd to verify that libodbchive.so library
is
able to satisfy all of it's dependencies:

% ldd -d -r ~/local/lib/libodbchive.so

Running ldd on isql won't tell you much because isql loads libodbchive.so
dynamically at runtime using the location of the driver lib specified in
your
odbc.ini file.

Hope this helps.

Carl

Reply via email to