Created 06-08-2018 09:48 AM
I am trying to Map a Hive ODBC datasource in IBM Campaign 9.1.2, but the connection to Hive database failed.
In Cloudera log on campaign server I have the following error:
ERROR 2241103616 Connection::SQLSetConnectAttr: [Cloudera][ODBC] (10210) :Attribute identifier invalid or not supported: 1068
When I test the connection with isql , it is OK , I get the SQL prompt.
Does anybody have any idea?
Thanks,
the technical environment is the following:
IBM Campaign 9.1.2 on a linux server (Redhat 6.6)
Cloudera odbc driver for Apache Hive version 2.5.16 64 bits
unix_ODBC version 2.2.14 64 bits
Kerberos authentification.
############################
Environnment variables
############################
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/appli/unica/Campaign/bin:$LD_LIBRARY_PATH:/usr/local/lib:/opt/cloudera/hiveodbc/lib/64
export LD_LIBRARY_PATH
export NLS_LANG=FRENCH_FRANCE.AL32UTF8
export CAMPAIGN_HOME=/appli/unica/Campaign
ODBCINI=/etc/odbc.ini
export ODBCINI
############################
cloudera.hiveodbc.ini
############################
[Driver]
## - Note that this default DriverManagerEncoding of UTF-32 is for iODBC.
## - unixODBC uses UTF-16 by default.
## - If unixODBC was compiled with -DSQL_WCHART_CONVERT, then UTF-32 is the correct value.
## Execute 'odbc_config --cflags' to determine if you need UTF-32 or UTF-16 on unixODBC
## - SimbaDM can be used with UTF-8 or UTF-16.
## The DriverUnicodeEncoding setting will cause SimbaDM to run in UTF-8 when set to 2 or UTF-16 when set to 1.
DriverManagerEncoding=UTF-32
ErrorMessagesPath=/opt/cloudera/hiveodbc/ErrorMessages/
LogLevel=0
LogPath=
SwapFilePath=/tmp
## - Uncomment the ODBCInstLib corresponding to the Driver Manager being used.
## - Note that the path to your ODBC Driver Manager must be specified in LD_LIBRARY_PATH (LIBPATH for AIX).
## - Note that AIX has a different format for specifying its shared libraries.
# Generic ODBCInstLib
# iODBC
ODBCInstLib=libodbcinst.so
# SimbaDM / unixODBC
#ODBCInstLib=libodbcinst.so
# AIX specific ODBCInstLib
# iODBC
#ODBCInstLib=libiodbcinst.a(libiodbcinst.so.2)
# SimbaDM
#ODBCInstLib=libodbcinst.a(odbcinst.so)
# unixODBC
#ODBCInstLib=libodbcinst.a(libodbcinst.so.1)
############################
############################
odbc.ini configuration
############################
[ODBC Data Sources]
Hive=Cloudera ODBC Driver for Apache Hive 64-bit
[Hive]
# Description: DSN Description.
# This key is not necessary and is only to give a description of the data source.
Description=Cloudera ODBC Driver for Apache Hive (64-bit) DSN
# Driver: The location where the ODBC driver is installed to.
Driver=/opt/cloudera/hiveodbc/lib/64/libclouderahiveodbc64.so
# When using No Service Discovery, specify the IP address or host name of the Hive server.
# When using ZooKeeper as the Service Discovery Mode, specify a comma-separated list of ZooKeeper
# servers in the following format:
# <zk_host1:zk_port1>,<zk_host2:zk_port2>,...
HOST=xxxxxx.dcn.fr.YYYYYYYY.com
# The TCP port Hive server is listening. This is not required when using ZooKeeper as the service
# discovery mode as the port is specified in the HOST connection attribute.
PORT=10000
# The name of the database schema to use when a schema is not explicitly specified in a query.
Schema=test
# Set to 0 to when connecting directory to Hive Server 2 (No Service Discovery).
# Set to 1 to do Hive Server 2 service discovery using ZooKeeper.
# Note service discovery is not support when using Hive Server 1.
ServiceDiscoveryMode=0
# The namespace on ZooKeeper under which Hive Server 2 znodes are added. Required only when doing
# HS2 service discovery with ZooKeeper (ServiceDiscoveryMode=1).
ZKNamespace=
# Set to 1 if you are connecting to Hive Server 1. Set to 2 if you are connecting to Hive Server 2.
HiveServerType=2
# The authentication mechanism to use for the connection.
# Set to 0 for No Authentication
# Set to 1 for Kerberos
# Set to 2 for User Name
# Set to 3 for User Name and Password
# Note only No Authentication is supported when connecting to Hive Server 1.
AuthMech=1
# The Thrift transport to use for the connection.
# Set to 0 for Binary
# Set to 1 for SASL
# Set to 2 for HTTP
# Note for Hive Server 1 only Binary can be used.
ThriftTransport=1
# When this option is enabled (1), the driver does not transform the queries emitted by an
# application, so the native query is used.
# When this option is disabled (0), the driver transforms the queries emitted by an application and
# converts them into an equivalent from in HiveQL.
UseNativeQuery=0
# Set the UID with the user name to use to access Hive when using AuthMech 2 to 8.
UID=unica
# The following is settings used when using Kerberos authentication (AuthMech 1 and 10)
# The fully qualified host name part of the of the Hive Server 2 Kerberos service principal.
# For example if the service principal name of you Hive Server 2 is:
# hive/myhs2.mydomain.com@EXAMPLE.COM
# Then set KrbHostFQDN to myhs2.mydomain.com
KrbHostFQDN=xxxxxx.dcn.fr.YYYYYYYY.com
# The service name part of the of the Hive Server 2 Kerberos service principal.
# For example if the service principal name of you Hive Server 2 is:
# hive/myhs2.mydomain.com@EXAMPLE.COM
# Then set KrbServiceName to hive
KrbServiceName=hive
# The realm part of the of the Hive Server 2 Kerberos service principal.
# For example if the service principal name of you Hive Server 2 is:
# hive/myhs2.mydomain.com@EXAMPLE.COM
# Then set KrbRealm to EXAMPLE.COM
KrbRealm=BDA-PHENIX.DCN.FR.YYYYYYYY.COM
# Set to 1 to enable SSL. Set to 0 to disable.
SSL=0
# Set to 1 to enable two-way SSL. Set to 0 to disable. You must enable SSL in order to
# use two-way SSL.
TwoWaySSL=0
# The file containing the client certificate in PEM format. This is required when using two-way SSL.
ClientCert=
# The client private key. This is used for two-way SSL authentication.
ClientPrivateKey=
# The password for the client private key. Password is only required for password protected
# client private key.
ClientPrivateKeyPassword=
Created 07-18-2018 10:00 AM
I found the solution:
in cloudera.hiveodbc.ini configuration file , use UTF-16 format for DriverManagerEncoding
replace :
DriverManagerEncoding=UTF-32
with
DriverManagerEncoding=UTF-16
Created 07-18-2018 10:00 AM
I found the solution:
in cloudera.hiveodbc.ini configuration file , use UTF-16 format for DriverManagerEncoding
replace :
DriverManagerEncoding=UTF-32
with
DriverManagerEncoding=UTF-16