Skip to content

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

@shysudo

Description

@shysudo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions