quintoandar / hive-metastore-client

A client for connecting and running DDLs on hive metastore.
Apache License 2.0
51 stars 15 forks source link

Kerberos support #68

Open LuisMoralesAlonso opened 2 years ago

LuisMoralesAlonso commented 2 years ago

Does this client works ith Kerberos authentication i activated in Hive Metastore Service?

pp-akursar commented 1 year ago

This worked for me (overriding the internal method that provides the tprotocol), provided I'm already performed a kinit:

class KerberosHiveMetastoreClient(HiveMetastoreClient):
    @staticmethod
    def _init_protocol(host: str, port: int) -> TBinaryProtocol:
        transport = TSocket.TSocket(host, int(port))
        transport = TTransport.TSaslClientTransport(transport, host=host, service="hive")
        transport = TTransport.TBufferedTransport(transport)
        return TBinaryProtocol.TBinaryProtocol(transport)