All Apps and Add-ons

Splunk DB Connect 1.1.6 with Hive jdbc: Why am I getting "command="dbinfo", Error getting database connection: Method not supported"?

DSigogne
Engager

Hi,

I have Splunk 6.1.3 with Splunk DB Connect 1.1.6 (updated from 1.1.4).
I'm getting an error when trying to use Splunk DB Connect with Hive jdbc (hiveserver2).
When validating the "External Database", the request works fine.
When trying to browse the database from App: Splunk DB Connect, I get the following error:

command="dbinfo", Error getting database connection: Method not supported

Here are my configs:
I added hiveserver2 jars in /dbx/bin/lib
database_types.conf

[hive]
displayName = hive
jdbcDriverClass = org.apache.hive.jdbc.HiveDriver
defaultPort = 10000
connectionUrlFormat = jdbc:hive2://{0}:{1}/{2}
testQuery = select * from test_table
defaultSchema = default
defaultCatalogName = default

database.conf

[hive]
database = default
host = host.name
isolation_level = DATABASE_SETTING
password = password
port = 10000
readonly = 1
type = hive
username = hive

Here are the logs from Database validation:

2014-12-18 17:05:38.173 :DEBUG:BridgeSession - Starting BridgeSession...
2014-12-18 17:05:38.173 :DEBUG:LRUCache - Cache hit for key com.splunk.dbx.sql.validate.DatabaseValidator (no need to handleResult producer)
2014-12-18 17:05:38.173 dbx3272:DEBUG:ExecutionContext - Initializing execution context with app.ctx=dbx and execId=dbx3272
2014-12-18 17:05:38.173 dbx3272:INFO:BridgeSession - Executing Bridge command: BridgeExecutionInfo{className=com.splunk.dbx.sql.validate.DatabaseValidator}
2014-12-18 17:05:38.173 dbx3272:DEBUG:BridgeSession - Bridge commands arguments: 
 [isolation_level=DATABASE_SETTING, password=password, type=hive, host=host.name, arguments=, username=hive, validate=1, readonly=1, port=10000, database=database_name]
2014-12-18 17:05:38.174 dbx3272:DEBUG:Database - Validating database connection for database Database{name='database', databaseType=GenericDatabaseType{name='hive'}, host='host.name', port=10000, username='hive', database='database_name'}
2014-12-18 17:05:38.174 dbx3272:DEBUG:Database - Connecting to database database
…
2014-12-18 17:05:38.368 dbx3272:DEBUG:Database - Database validation successful
2014-12-18 17:05:38.369 dbx3272:INFO:BridgeSession - Execution finished in duration=196 ms with status=0

Results from trying to display Hive database from Splunk DB Connect:

2014-12-18 16:58:21.163 :DEBUG:BridgeSession - Starting BridgeSession...
2014-12-18 16:58:21.163 :DEBUG:LRUCache - Cache hit for key com.splunk.dbx.command.DatabaseInfoCommand (no need to handleResult producer)
2014-12-18 16:58:21.164 dbx1881:DEBUG:ExecutionContext - Initializing execution context with app.ctx=dbx and execId=dbx1881
2014-12-18 16:58:21.164 dbx1881:INFO:BridgeSession - Executing Bridge command: BridgeExecutionInfo{className=com.splunk.dbx.command.DatabaseInfoCommand}
2014-12-18 16:58:21.164 dbx1881:DEBUG:BridgeSession - Bridge commands arguments: [database=Hive, type=schemas]
2014-12-18 16:58:21.164 dbx1881:INFO:DatabaseInfoCommand - Fetching schemas for database=Hive
2014-12-18 16:58:21.164 dbx1881:DEBUG:Database - Fetching connection from factory...
2014-12-18 16:58:21.164 dbx1881:DEBUG:PooledConnectionFactory - Fetching connection from pool...
2014-12-18 16:58:21.164 dbx1881:DEBUG:PooledConnectionFactory - Creating database connection for database=Hive
2014-12-18 16:58:21.164 dbx1881:DEBUG:Database - Connecting to database Hive
…
2014-12-18 16:58:21.186 dbx1881:ERROR:DatabaseInfoCommand - Error while executing command: Error getting database connection: Method not supported

From Hive logs, the creation is working fine and the testQuery = select * from test_table returns without problem. The second case to display database starts "use database_name" fine and then stops when the error appears on Splunk side.

HBase and Postgres connectors work fine.

Tags (1)
1 Solution

slapie_splunk
Splunk Employee
Splunk Employee

Hi,

The 'read-only' option is not supported by Hive jdbc driver yet.
To fix the issue you'll have to edit database.conf and set 'readonly = 0'.

You can uncheck 'read-only' in the 'External Databases' configuration menu of DBConnect also.

Cheers,
Stephane

View solution in original post

slapie_splunk
Splunk Employee
Splunk Employee

Hi,

The 'read-only' option is not supported by Hive jdbc driver yet.
To fix the issue you'll have to edit database.conf and set 'readonly = 0'.

You can uncheck 'read-only' in the 'External Databases' configuration menu of DBConnect also.

Cheers,
Stephane

DSigogne
Engager

Thanks Stephane,
Hive jdbc is working now.

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

WATCH NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If exploited, ...

Enter the Splunk Community Dashboard Challenge for Your Chance to Win!

The Splunk Community Dashboard Challenge is underway! This is your chance to showcase your skills in creating ...

.conf24 | Session Scheduler is Live!!

.conf24 is happening June 11 - 14 in Las Vegas, and we are thrilled to announce that the conference catalog ...