[
https://issues.apache.org/jira/browse/CALCITE-4956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17463650#comment-17463650
]
maxwellguo commented on CALCITE-4956:
-------------------------------------
Thank you。
I just want to support another way of post the avatica's openconnection info
when doing openconnection request. I just make the uri 's query which is some
key-value pairs. from
https://github.com/apache/calcite-avatica-go/blob/fa87f84dd6492de4aeedb005875f11549d48a895/dsn.go#L215
we can just set the
{code:java}
parsed.RawQuery = "" //delete this code, let rawQuery pass to parse.endpoint
{code}
https://github.com/apache/calcite-avatica-go/blob/master/driver.go#L91
add some parser of RawQuery (for it is also key-value pairs) and
{code:java}
for k, v := range RawQuery.parse {
info[k] = v
}
{code}
make the rawQuery's key value pairs be doing the real info value setting.
Just like this . If we do not change the go's database/sql 's code ,I think we
can only passed the info map from this way.
But the best way is to support from database/sql 's driver.go code, And we can
change the
NewConnector(dsn string) -> NewConnector(Info map,dsn string)
> calcite-avatica-go should post info when open connection
> --------------------------------------------------------
>
> Key: CALCITE-4956
> URL: https://issues.apache.org/jira/browse/CALCITE-4956
> Project: Calcite
> Issue Type: Bug
> Components: avatica-go
> Affects Versions: avatica-go-5.0.0
> Reporter: maxwellguo
> Assignee: Francis Chuang
> Priority: Major
>
> see
> https://calcite.apache.org/avatica/docs/json_reference.html#openconnectionrequest
>
> for openconnection request we can set info that is some key-value pairs .but
> for avatica-go we do not get the chance to post the info, though
> https://github.com/apache/calcite-avatica-go/blob/master/driver.go#L88 the
> code do set some info but after seeing the code
> https://github.com/apache/calcite-avatica-go/blob/master/driver.go#L61 we
> will know the info is nil, so the info will never be posted.
> after reviewing the database/sql of go's source code, I found that the
> https://github.com/apache/calcite-avatica-go/blob/master/driver.go#L60
> NewConnector will only go one input paramters that is dsn ,so if we want to
> post some info ,it is useless.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)