You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "maxwellguo (Jira)" <ji...@apache.org> on 2021/12/22 07:24:00 UTC
[jira] [Comment Edited] (CALCITE-4956) calcite-avatica-go should post info when open connection
[ https://issues.apache.org/jira/browse/CALCITE-4956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17463614#comment-17463614 ]
maxwellguo edited comment on CALCITE-4956 at 12/22/21, 7:23 AM:
----------------------------------------------------------------
the code of avatica-go-> driver.go is like this and if we use the go's lib ,the c you specified is nil and the c.Info is nil,we can not add a new construct function for go lib do support us to add a info too (if I am right) https://github.com/golang/go/blob/master/src/database/sql/sql.go#L816.
{code:java}
{code:java}
// Some comments here
// NewConnector creates a new connector
func NewConnector(dsn string) driver.Connector {
return &Connector{nil, nil, dsn}
}
func (c *Connector) Connect(context.Context) (driver.Conn, error) {
config, err := ParseDSN(c.dsn)
{code}
was (Author: maxwellguo):
the code of avatica-go-> driver.go is like this and if we use the go's lib ,the c you specified is nil and the c.Info is nil,we can not add a new construct function for go lib do support us to add a info too (if I am right) https://github.com/golang/go/blob/master/src/database/sql/sql.go#L816.
{code:java}
// Some comments here
// NewConnector creates a new connector
func NewConnector(dsn string) driver.Connector {
return &Connector{nil, nil, dsn}
}
func (c *Connector) Connect(context.Context) (driver.Conn, error) {
config, err := ParseDSN(c.dsn)
> 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)