zeroshade commented on code in PR #40090:
URL: https://github.com/apache/arrow/pull/40090#discussion_r1492689323
##########
go/arrow/flight/flightsql/driver/driver.go:
##########
@@ -37,34 +38,50 @@ import (
)
type Rows struct {
- schema *arrow.Schema
- records []arrow.Record
- currentRecord int
- currentRow int
+ schema *arrow.Schema
+ recordChan chan arrow.Record
+ currentRecord arrow.Record
+ currentRecordMux sync.Mutex
+ currentRow uint64
+ initializedChan chan bool
+ streamError error
+}
+
+func newRows() *Rows {
+ return &Rows{
+ recordChan: make(chan arrow.Record, 1),
Review Comment:
I'd be fine with making it configurable in a follow-up PR. sure.
As for a suggestion for implementing the configuable buffer size, there are
two common patterns:
* In the `Open` and `Connector` handling the uri, you can use a delimiter
and allow passing various options in similar to how an ODBC DSN works. During
`Open` you can then parse out the options and store them in the driver
instance, then have this function take in the buffer size as a parameter which
can be passed in.
* You could provide context functions like `WithBufferSize` and then pull
the value out of the context at query time when you construct the Rows object,
defaulting to 1 if the user didn't stick it into the context.
--
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]