1

I'm trying to connect to a Hive server with Jaydebeapi in python.

But I don't know which jar file I need to add to etablish my connection.

driver = 'org.apache.hive.jdbc.HiveDriver'
url_path = 'jdbc:hive2://link:port/db'
driver_arg ={'ssl':'*',
             'sslTrustStore':'*',
             'trustStorePassword':'*',
             'transportMode':'*',
             'httpPath':'*',
             'hive.tez.container.size':'*',
             'hive.tez.java.opts':'*'
            }

jarFile = [DIR + '']

conn_hive = jaydebeapi.connect(jclassname=driver,
                               url=url_path,
                               driver_args=driver_arg,
                               jars=jarFile
                              )

If you have any idea about which

Actually, I got this error :

java.lang.NoClassDefFoundErrorPyRaisable: java.lang.NoClassDefFoundError: org/apache/hive/service/cli/thrift/TCLIService$Iface

If you have ideas or docs to share related to org.apache.hive.jdbc.HiveDriver and the jar. Thanks in advance

LookingFor
  • 11
  • 1
  • 2

1 Answers1

0

I am not able to comment so I will drop this as an answer.The hive jar is known not to have all the necessary dependencies needed to connect to hive. I used this library hive-jdbc-uber-2.6.3.0-235.jar instead with the below config

HIVE_CONFIG = {
    "jclassname":"org.apache.hive.jdbc.HiveDriver",
    "url": HIVE_URL,
    "driver_args": {"user": f'{HIVE_USER}', "password": f'{HIVE_PASSWORD}'},
    "jars": "../libs/hive-jdbc-uber-2.6.3.0-235.jar
    }

ftchidzix
  • 21
  • 5
  • Didn't match my use case :/ .. I kept getting the "java.lang.RuntimeException: Class org.apache.hive.jdbc.HiveDriver not found" error – Idhem Apr 28 '21 at 15:18