[
https://issues.apache.org/jira/browse/CALCITE-3277?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16912739#comment-16912739
]
Francis Chuang commented on CALCITE-3277:
-----------------------------------------
I haven't used druid before, but I noticed the following in the [druid
docs|[https://druid.apache.org/docs/latest/querying/sql]]:
* `druid.sql.avatica.enable` enables JDBC querying using
`/druid/v2/sql/avatica/` and defaults to true. The Go avatica driver does not
implement JDBC, rather, it implements protobuf over HTTP.
* `druid.sql.http.enable` enables JSON over HTTP and defaults to true. As the
Go avatica driver does not use JSON, it would fail.
I'd suggest adding a debug statement here:
[https://github.com/apache/calcite-avatica-go/blob/master/http_client.go#L136]
, to see the raw response from the server. Something like
`fmt.Println(response)` would do.
> calcite-avatica-go: panic: proto: can't skip unknown wire type 4
> ----------------------------------------------------------------
>
> Key: CALCITE-3277
> URL: https://issues.apache.org/jira/browse/CALCITE-3277
> Project: Calcite
> Issue Type: Bug
> Components: avatica-go
> Reporter: Shurmin Evgeniy
> Assignee: Francis Chuang
> Priority: Critical
> Fix For: avatica-go-5.0.0
>
>
> I can't perform simple query to druid using
> {{github.com/apache/calcite-avatica-go. }}
> Code:
> {code:java}
> package main
> import (
> "database/sql"
> "fmt"
> _ "github.com/apache/calcite-avatica-go/v4"
> )
> func main() {
> db, err := sql.Open("avatica",
> "http://********:8888/druid/v2/sql/avatica/")
> if err != nil { panic(err) }
> rows, err := db.Query(`SELECT * FROM sys.servers`)
> if err != nil { panic(err) }
> defer func() {
> if err := rows.Close(); err != nil { panic(err) }
> }()
> for rows.Next() {
> var server, host float64
> err = rows.Scan(&server, &host)
> if err != nil { panic(err) }
> fmt.Printf("server: %v, host: %v\n", server, host)
> }
> }
> {code}
> Console:
> {{panic: proto: can't skip unknown wire type 4}}
> {{goroutine 1 [running]:main.main() main.go:17 +0x30d}}
> {{Process finished with exit code 2}}
> Golang:
> {{go version go1.12.7 darwin/amd64}}
--
This message was sent by Atlassian Jira
(v8.3.2#803003)