Comments (3)
Hello, you should definitely be using localhost
instead of localhost:
, that's what's causing the first stacktrace.
I'm not sure how you are getting the second error, can you share the code? I'd suggest tweaking this line and setting auth to "NONE"
, you'll have to set the username and password as well:
configuration.Username = "myUsername"
configuration.Password = "myPassword"
There's some more info in this section of the readme.
from gohive.
Helloes,
curiously enough, I ran the exact same code today and it worked. Well, it connected to Hive, created the table but hung on insert. So, the following problem is with Hive itself and not with this code, which is good to know.
Here is the code I used:
package main
import (
"context"
"log"
"github.com/beltran/gohive"
)
func main() {
ctx := context.Background()
configuration := gohive.NewConnectConfiguration()
configuration.Service = "hive"
configuration.FetchSize = 1000
// Previously kinit shoulds have done: kinit -kt ./secret.keytab hive/[email protected]
connection, errConn := gohive.Connect("localhost", 10000, "NONE", configuration)
if errConn != nil {
log.Fatal("Error in gohive.Connect", errConn)
}
cursor := connection.Cursor()
cursor.Exec(ctx, "CREATE TABLE myTable (a INT, b STRING)")
if cursor.Err != nil {
log.Fatal(cursor.Err)
}
cursor.Exec(ctx, "INSERT INTO myTable VALUES(1, '1'), (2, '2'), (3, '3'), (4, '4')")
if cursor.Err != nil {
log.Fatal(cursor.Err)
}
cursor.Exec(ctx, "SELECT * FROM myTable")
if cursor.Err != nil {
log.Fatal(cursor.Err)
}
var i int32
var s string
for cursor.HasMore(ctx) {
if cursor.Err != nil {
log.Fatal(cursor.Err)
}
cursor.FetchOne(ctx, &i, &s)
if cursor.Err != nil {
log.Fatal(cursor.Err)
}
log.Println(i, s)
}
cursor.Close()
connection.Close()
}
from gohive.
Hello, happy to hear, I'll close this since the issue is with hive and not the driver.
from gohive.
Related Issues (20)
- Bad SASL negotiation status: 3 (GSS initiate failed) HOT 9
- panic: runtime error: invalid memory address or nil pointer dereference HOT 1
- v1.5.3 compile error HOT 2
- please answer,thank you HOT 3
- How to Timeout SQL queries? HOT 2
- LDAP authentication with HTTPS Does Not Work HOT 8
- Exec PENDING_STATE HOT 2
- go build error HOT 1
- some problems to access to hiveserver2 without kinit HOT 2
- Cursor.totalRows is 0
- panic: runtime error: invalid memory address or nil pointer dereference HOT 1
- How to solve "Incorrect FrameSize"? HOT 6
- could we generate cpp bindings
- What to do if the hive service is actively disconnected due to timeout? HOT 5
- Incorrect frame size HOT 6
- ConnectZookeeper panic HOT 1
- use in hive 1.1.0 fetch data uncompleted HOT 1
- hive-site.xml location HOT 1
- panic: runtime error: invalid memory address or nil pointer dereference HOT 1
- Assignment Mismatch | Thrift HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gohive.