Skip to content

Conversation

@ddh-5230
Copy link
Contributor

Modified the process of converting stdsql standard results to Arrow and directly used the Arrow support provided by DuckDB.

@ddh-5230 ddh-5230 changed the title Migrate to DuckDB Arrow for Query Execution feat:Migrate to DuckDB Arrow for Query Execution Dec 27, 2024
@ddh-5230 ddh-5230 changed the title feat:Migrate to DuckDB Arrow for Query Execution feat:migrate to duckdb arrow for query execution Dec 27, 2024
@ddh-5230 ddh-5230 requested a review from fanyang01 December 27, 2024 14:00
main.go Outdated
log.Fatal("Failed to get DuckDB connection")
}

srv, err := flightsqlserver.NewSQLiteFlightSQLServer(db, duckConn)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this connection serves all flightsql queries. While this is a valid approach, it is not good for concurrency. You can get a new duckdb.Conn whenever needed using the following method:

conn, err := s.db.Conn(context.Background())
// error handling...
var duckConn *duckdb.Conn
err = conn.Raw(func (driverConn any) error {
    duckConn = driverConn.(*duckdb.Conn)
    return nil
})
...

This can be defined as a helper method.

@ddh-5230 ddh-5230 requested a review from fanyang01 January 3, 2025 08:49
Copy link
Contributor

@fanyang01 fanyang01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@fanyang01 fanyang01 enabled auto-merge (squash) January 6, 2025 09:41
@fanyang01 fanyang01 disabled auto-merge January 6, 2025 09:43
@fanyang01 fanyang01 merged commit 0ba0b75 into main Jan 6, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants