N
N
Nikolay Baranenko2018-08-28 19:47:05
go
Nikolay Baranenko, 2018-08-28 19:47:05

What library would you recommend for a client to Hive?

Hello.
I need a client for Hive on GoLang
Found this repository araddon/hive :
client listing example

package main


import (
    hive "github.com/araddon/hive"
    "log"
    "fmt"
)


func init() {
    hive.MakePool("localhost:10000")
}


func main() {


    conn, err := hive.GetHiveConn()
    if err == nil {


        er, err := conn.Client.Execute("select * from tb where date='2016-09-09' limit 10")
        if er == nil && err == nil {
            for {
                row, _, _ := conn.Client.FetchOne()
                if len(row) > 0 { 
                    fmt.Println(row)
                } else {
                    return
                }   
            }   
        } else {
            log.Println(er, err)
        }   
    }   
    if conn != nil {
        // make sure to check connection back into pool
        conn.Checkin()
    }   
}

BUT I did not find how to pass username and password...
Please help with this library or what can you recommend as an alternative?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
RidgeA, 2018-08-28
@RidgeA

1 - it is recommended to use another package in the description
2 - it may work to pass the login and password in the address term

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question