0

I am developing Nifi processor to connect hive and execute queries using controller service. I was able to deploy it in Nifi and trying to run it but it fails with below exception

RegisterSchema[id=6b1152ca-015f-1000-d7b9-e44e251aba70] failed to process due to java.lang.NoSuchFieldError: HIVE_CLI_SERVICE_PROTOCOL_V7; rolling back session: {}
java.lang.NoSuchFieldError: HIVE_CLI_SERVICE_PROTOCOL_V7
    at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:175)
    at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:105)
    at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
    at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
    at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
    at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
    at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
    at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)

Below is my version dependency

Hive Version : 1.1.0 Hadoop : 2.7.3

<!-- https://mvnrepository.com/artifact/org.apache.hive/hive-jdbc -->
        <dependency>
            <groupId>org.apache.hive</groupId>
            <artifactId>hive-jdbc</artifactId>
            <version>1.1.0-cdh5.10.0</version>

        </dependency>
            <!-- https://mvnrepository.com/artifact/org.apache.hive/hive-jdbc -->
            <dependency>
                <groupId>org.apache.hive</groupId>
                <artifactId>hive-service</artifactId>
                <version>1.1.0-cdh5.10.0</version>
            </dependency>

Any pointers here ?

Shashi
  • 2,686
  • 7
  • 35
  • 67

1 Answers1

2

This SO question seems related, and implies that Apache Hive 1.1.0 is "too old" for the Hive you have running on Hadoop 2.6.0. If you are planning only to deploy on a vendor-specific version of Hadoop (such as HDP or CDH, versus Apache Hadoop), then you may want to add their repository to the POM (see the top-level NiFi POM for examples) and set the version to the vendor-specific version that corresponds to their release of Hadoop.

For example, the existing Hive NAR in Apache NiFi is not compatible with newer versions of HDP, as HDP Hive is newer than the corresponding Apache Hive baseline. For that reason it is possible to set a vendor-specific profile (-Phortonworks in this example) and override properties such as hive.version and hive.hadoop.version, set to vendor-specific values.

mattyb
  • 11,693
  • 15
  • 20
  • I am using cloudera with Hive 1.1 and was builiding against with below pom does not resolve it. https://mvnrepository.com/artifact/org.apache.hive/hive-jdbc/1.1.0-cdh5.5.1 Also i tried with Hive 2.7.x with Hive 1.1.0 combination resulting in same exception – Shashi Oct 30 '17 at 17:06
  • Is your CDH version 5.5.1? Is the version of Hive on your CDH cluster version 1.1.0-cdh5.5.1? – mattyb Oct 30 '17 at 17:09
  • Updated question with exact configuration in pom.xml – Shashi Oct 30 '17 at 17:34
  • I'm not sure what's going on then. According to https://issues.apache.org/jira/browse/HIVE-6647, V7 should be in Hive from a LONG time ago. – mattyb Oct 30 '17 at 17:48
  • Well it just worked for me but really not sure what was root cause. It did fresh install of Nifi 1.2 and flow file started flowing .. :) – Shashi Oct 30 '17 at 20:05