- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
How to update Driver Class for DBCPConnectionPool for NIFI - Hive
- Labels:
-
Apache NiFi
Created on ‎11-30-2017 04:35 PM - edited ‎08-17-2019 08:52 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am aware of PutHiveSQL processor , but want to use DBCPConnectionPool
Error :- 2017-11-30 11:26:05,569 ERROR [StandardProcessScheduler Thread-2] o.a.n.c.s.StandardControllerServiceNode DBCPConnectionPool[id=0160100a-8103-194b-50a7-ce556048b78e] Failed to invoke @OnEnabled method due to org.apache.nifi.reporting.InitializationException: Can't load Database Driver: {} org.apache.nifi.reporting.InitializationException: Can't load Database Driver at org.apache.nifi.dbcp.DBCPConnectionPool.getDriverClassLoader(DBCPConnectionPool.java:249) at org.apache.nifi.dbcp.DBCPConnectionPool.onConfigured(DBCPConnectionPool.java:198) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
Created ‎12-01-2017 03:05 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is highly recommended to not put your JDBC driver JAR(s) in NiFi's lib/ directory, as they can disturb the behavior of the other components in the system. I recommend a separate path containing the driver JAR and all its dependencies in a flat directory. Also on Windows you may need to use the URL style "file://C/" or just "/" instead of "C:\" but I'm not sure about that part.
Another caveat with Hive drivers is that some (including the official Apache Hive JDBC driver that comes with NiFi's Hive bundle) do not support all JDBC methods, such as setQueryTimeout(), or have different mechanisms for getting at table metadata (from the ResultSetMetaData rather than DatabaseMetaData or vice versa) than what is used by ExecuteSQL. Those reasons are why there are SelectHiveQL and PutHiveQL processors, so the Hive driver could be included and the processors can perform any driver-specific functions/workarounds as necessary. So you may find that the SQL processors do not work with your Hive driver, but I am not familiar with that driver so I can't say for sure. If you see errors such as "Method not supported", then this usually indicates the scenario I'm talking about.
