Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (ns clive.core
- (:import [org.apache.hadoop.hive.service HiveClient]
- [org.apache.thrift.transport TSocket]
- [org.apache.thrift.protocol TBinaryProtocol]))
- (defn hive-socket
- [host port]
- (doto (TSocket. host port) .open))
- (defn hive-client
- [socket]
- (HiveClient. (TBinaryProtocol. socket)))
- (defn -main
- [& args]
- (with-open [sock (hive-socket "b57" 10000)]
- (let [client (hive-client sock)
- result (.execute client "describe deals_production_people")]
- (.fetchAll result))))
Add Comment
Please, Sign In to add comment