jacobmarble commented on PR #34331:
URL: https://github.com/apache/arrow/pull/34331#issuecomment-1446986510

   > @srebhan from the arrow side it's more of a maintenance question. it's 
hard to justify maintaining two separate implementations. The ADBC FlightSQL 
driver is basically a thin wrapper around the FlightSQL client already and the 
`adbc/sqldriver` package shouldn't be adding much in the way of overhead 
(honestly I'd be surprised if any overhead it adds dwarfs the actual network IO 
costs....). At a minimum we should document the use case, either through your 
work here or by documenting how to leverage ADBC's flight sql driver.
   > 
   > Just as a thought, would you be able to create a benchmark that uses 
`database/sql` against IOx that we can run with both of your solution here and 
the ADBC driver so we can compare and see if there's a significant difference 
(thus justifying the separate implementation)?
   
   I'm not sure performance is the concern (@srebhan please correct or 
confirm). IMO, this driver is valuable because:
   1. [one conventional golang import 
statement](https://go.dev/doc/database/open-handle#database_driver)
   
   ```golang
   import _ "github.com/apache/arrow/go/v12/arrow/flight/flightsql"
   ...
   sql.Open("flightsql", dsn)
   ```
   vs
   ```golang
   import "github.com/apache/arrow-adbc/go/adbc/driver/flightsql"
   import "github.com/apache/arrow-adbc/go/adbc/sqldriver"
   sql.Register("flightsql", sqldriver.Driver{flightsql.Driver{}})
   ...
   sql.Open("flightsql", dsn)
   ```
   
   2. easy to discover by googling `FlightSQL golang database/sql`
   3. fewer dependencies
   
   All of the above are satisfied by this PR, and not by the ADBC wrapper.
   
   ---
   
   On the other hand, this PR means the Go/Arrow community would maintain two 
FlightSQL `database/sql` drivers, [which has been discussed 
before](https://github.com/apache/arrow-adbc/issues/315#issuecomment-1372695586).
   
   Here's an alternative that satisfies 1 and 2, but not 3 (which hardly 
matters these days), and retains a the implementation:
   
   New module (including go.mod) containing only:
   ```golang
   import (
        "github.com/apache/arrow-adbc/go/adbc/driver/flightsql"
        "github.com/apache/arrow-adbc/go/adbc/sqldriver"
   )
   
   func init() {
        sql.Register("flightsql", sqldriver.Driver{
                Driver: flightsql.Driver{},
        })
   }
   ```
   
   The module could live as 
`github.com/apache/arrow/go/v12/arrow/flight/flightsql/sqldriver`, or it could 
live in the ADBC repo and get a vanity name like 
`go.arrow.apache.org/flightsql/sqldriver`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to