Shashi
Shashi

Reputation: 2714

Nifi Processor to connect Hive | HIVE_CLI_SERVICE_PROTOCOL_V7 Exception

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 ?

Upvotes: 0

Views: 779

Answers (1)

mattyb
mattyb

Reputation: 12083

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.

Upvotes: 2

Related Questions