Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Hive >> mail # user >> Compiling Hive ODBC


+
Sebastien FLAESCH 2013-04-26, 11:33
+
Sebastien FLAESCH 2013-04-26, 11:40
+
Sebastien FLAESCH 2013-04-26, 13:09
+
Carl Steinbach 2013-04-29, 18:48
Copy link to this message
-
Re: Compiling Hive ODBC
Thank you Carl, but I still have problems to build Hive ODBC:

I followed the instruction from this page (I believe the doc is wrong):

https://cwiki.apache.org/Hive/hiveodbc.html

Where it says:

"Build the Hive client by running the following command from HIVE_HOME..."

Here is my env:

----------------------------------------------------------
hive@orca:~$ cat env-apache.sh
JAVA_HOME="/usr/lib/jvm/java-6-sun"
export JAVA_HOME
JRE_HOME="$JAVA_HOME/jre"
export JRE_HOME
PATH=$JAVA_HOME/bin:$PATH

HADOOP_HOME=/home/hive/hadoop-0.23.7
export HADOOP_HOME
PATH=$HADOOP_HOME/bin:$PATH
export PATH

HIVE_HOME=/home/hive/hive-0.10.0
export HIVE_HOME
PATH=$HIVE_HOME/bin:$PATH
export PATH

THRIFT_HOME=/home/hive/thrift-0.9.0
export THRIFT_HOME
----------------------------------------------------------

But:

----------------------------------------------------------
hive@orca:~$ cd $HIVE_HOME
hive@orca:~/hive-0.10.0$ ant compile-cpp -Dthrift.home=$THRIFT_HOME
Buildfile: build.xml does not exist!
Build failed
----------------------------------------------------------
And when I go to the src directory, it goes further, but then
I have missing Thrift header files:

----------------------------------------------------------
hive@orca:~/hive-0.10.0$ cd src
hive@orca:~/hive-0.10.0/src$ ant compile-cpp -Dthrift.home=$THRIFT_HOME
...
compile-cpp:
      [echo] Project: odbc
      [exec] mkdir -p /home/hive/hive-0.10.0/src/build/metastore/objs
      [exec] g++ -Wall -g -fPIC -m32 -DARCH32 -I/home/hive/thrift-0.9.0/include/thrift -I/home/hive/thrift-0.9.0/include/thrift/fb303 -I/include
-I/home/hive/hive-0.10.0/src/service/src/gen/thrift/gen-cpp -I/home/hive/hive-0.10.0/src/ql/src/gen/thrift/gen-cpp
-I/home/hive/hive-0.10.0/src/metastore/src/gen/thrift/gen-cpp -I/home/hive/hive-0.10.0/src/odbc/src/cpp -c
/home/hive/hive-0.10.0/src/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp -o
/home/hive/hive-0.10.0/src/build/metastore/objs/ThriftHiveMetastore.o
      [exec] In file included from /home/hive/hive-0.10.0/src/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp:7:
      [exec] /home/hive/hive-0.10.0/src/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h:10:39: error: thrift/TDispatchProcessor.h: No such file
or directory
      [exec] In file included from /home/hive/hive-0.10.0/src/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.h:11,
      [exec]                  from /home/hive/hive-0.10.0/src/metastore/src/gen/thrift/gen-cpp/ThriftHiveMetastore.cpp:7:
      [exec] /home/hive/hive-0.10.0/src/metastore/src/gen/thrift/gen-cpp/hive_metastore_types.h:10:27: error: thrift/Thrift.h: No such file or directory
      [exec] /home/hive/hive-0.10.0/src/metastore/src/gen/thrift/gen-cpp/hive_metastore_types.h:11:42: error: thrift/TApplicationException.h: No such
file or directory
...
----------------------------------------------------------

In fact there is no such directory:

/home/hive/thrift-0.9.0/include/thrift/fb303

I see only:

----------------------------------------------------------
hive@orca:~/hive-0.10.0/src$ ls /home/hive/thrift-0.9.0/include/thrift
c_glib
----------------------------------------------------------

According to:

http://mail-archives.apache.org/mod_mbox/hive-user/201110.mbox/%[EMAIL PROTECTED]%3E

I need to build fb303 component of thrift...

So I tried to build "fb303" in the thrift sources.

Note that I ran thrift's configure with a non-system installation target directory:

----------------------------------------------------------
hive@orca:~$ cd tmp/thrift-0.9.0/contrib/fb303
hive@orca:~/tmp/thrift-0.9.0/contrib/fb303$ ./configure --prefix=/home/hive/thrift-0.9.0
----------------------------------------------------------

But it could not find /usr/local/bin/thrift and /usr/local/include/thrift...

So I created links:

----------------------------------------------------------
/usr/local/bin/thrift -> /home/hive/thrift-0.9.0/bin/thrift
/usr/local/include/thrift -> /home/hive/thrift-0.9.0/include/thrift

But:

hive@orca:~/tmp/thrift-0.9.0/contrib/fb303$ make

make  all-recursive
make[1]: Entering directory `/home/hive/tmp/thrift-0.9.0/contrib/fb303'
Making all in .
make[2]: Entering directory `/home/hive/tmp/thrift-0.9.0/contrib/fb303'
make[2]: Nothing to be done for `all-am'.
make[2]: Leaving directory `/home/hive/tmp/thrift-0.9.0/contrib/fb303'
Making all in cpp
make[2]: Entering directory `/home/hive/tmp/thrift-0.9.0/contrib/fb303/cpp'
make  all-am
make[3]: Entering directory `/home/hive/tmp/thrift-0.9.0/contrib/fb303/cpp'
g++ -DPACKAGE_NAME=\"libfb303\" -DPACKAGE_TARNAME=\"libfb303\" -DPACKAGE_VERSION=\"20080209\" -DPACKAGE_STRING=\"libfb303\ 20080209\"
-DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_BOOST=/\*\*/ -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1
-DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_INTTYPES_H=1
-DHAVE_NETINET_IN_H=1 -I.  -I.. -Igen-cpp -I/usr/local/include/thrift -I/usr/include     -Wall -O3 -MT FacebookService.o -MD -MP -MF
.deps/FacebookService.Tpo -c -o FacebookService.o `test -f 'gen-cpp/FacebookService.cpp' || echo './'`gen-cpp/FacebookService.cpp
In file included from gen-cpp/FacebookService.cpp:7:
gen-cpp/FacebookService.h:10:39: error: thrift/TDispatchProcessor.h: No such file or directory
In file included from gen-cpp/FacebookService.h:11,
                  from gen-cpp/FacebookService.cpp:7:


...

Seb
On 04/29/2013 08:48 PM, Carl Steinbach wrote:
+
Sebastien FLAESCH 2013-04-30, 14:13
+
Sebastien FLAESCH 2013-04-30, 14:39
+
Sebastien FLAESCH 2013-04-30, 15:51