Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PrepareContext and Prepare function calls hang up to return statementHandlers #9

Open
shysudo opened this issue Jul 29, 2024 · 0 comments

Comments

@shysudo
Copy link

shysudo commented Jul 29, 2024

Hi Team,

I am new to the apache drill and currently I am using the latest factset drill client library for calling the preperedStatement functionality of the sql, where the sql function call to Prepare() and PrepareContext() both are hang up in drill client call https://github.com/factset/go-drill/blob/v1.2.0/client.go#L427 expecting the message on the queryHandleChannel of type queryHandle := make(chan *rpc.CompleteRpcMessage)

Can someone please explain why it is happening, If I have missed something, explain me how we can resolve this issue.

Sample code of the same issue :

`package main

import (
"context"
"database/sql"
"fmt"
"strings"

_ "github.com/factset/go-drill/driver"

)

func main() {
sqlDb := DrillConnect()
var contx = context.Background()
stmt1, err := sqlDb.PrepareContext(contx, "SELECT * FROM dfs./home/ghuchhar/Downloads/apache-drill-1.21.1/sample-data/region.parquet")
if err != nil {
fmt.Println(err.Error())
return
}
res, err := stmt1.Query()
if err != nil {
fmt.Println(err)
}
for res.Next() {
fmt.Println(res.Columns())
}
}

func DrillConnect() *sql.DB {
props := []string{
"host=0.0.0.0",
"port=31010",
}
db, err := sql.Open("drill", strings.Join(props, ";"))
if err != nil {
fmt.Println(err)
return nil
}
if err := db.Ping(); err != nil {
fmt.Println(err)
return nil
}
return db
}`

Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant