IBM Support

How to query Impala using Db2 Federation through ODBC driver?

Question & Answer


Question

How to query Impala using Db2 Federation through ODBC driver?

Answer

Before You Begin
 
Enable Federation feature and restart Db2 to make it effective.
$ db2 update dbm cfg using federated YES
Pre-Configuration
 
1. Make sure the required ODBC drivers are installed correctly.
ls ~/sqllib/federation/odbc/lib/FOimpala*.so
 
2. Make sure the data source is accessible to Federation server.
$ telnet matters1.fyre.ibm.com 21050
Trying 9.30.0.189...
Connected to matters1.fyre.ibm.com.
Escape character is '^]'.
 
3. Create server, user mapping, nickname, and query the nickname.
$ create server SERVER1 type impala version 6.0  OPTIONS(host 'matters1.fyre.ibm.com',port '21050', dbname 'default')

$ create user mapping for user server SERVER1 options(REMOTE_AUTHID 'cloudera',REMOTE_PASSWORD 'cloudera')

$ create nickname n1 for server1."alltype_test"

$ select count(*) from n1

1
-----------
          2

  1 record(s) selected.

[{"Type":"SW","Line of Business":{"code":"","label":""},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSCAVPX","label":"Federated Server"},"ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Version(s)"}]

Document Information

Modified date:
07 May 2021

UID

ibm16447049