arnoldwakim opened a new pull request, #4308:
URL: https://github.com/apache/arrow-adbc/pull/4308

   ## Summary
   
   Reorder `IngestStream` and `IngestStreamContext` to set 
`OptionKeyIngestTargetTable` and `OptionKeyIngestMode` before calling 
`BindStream`, matching drivers that require ingest targets up front (e.g., 
FlightSQL).
   
   Keep all other ingest option handling and execution flow unchanged.
   
   Evidence (FlightSQL requirement):
   
   
[`go/adbc/driver/flightsql/flightsql_statement.go:630-656`:](https://github.com/apache/arrow-adbc/blob/b4f1e3e08c2413180fef4811e94d7677949da403/go/adbc/driver/flightsql/flightsql_statement.go#L635)
   
   ```go
   func (s *statement) BindStream(_ context.Context, stream array.RecordReader) 
error {
        // For bulk ingest, bind to the statement
        if s.targetTable != "" {
                if s.bound != nil {
                        s.bound.Release()
                        s.bound = nil
                }
                if s.streamBind != nil {
                        s.streamBind.Release()
                }
                s.streamBind = stream
                if s.streamBind != nil {
                        s.streamBind.Retain()
                }
                return nil
        }
   
        if s.prepared == nil {
                return adbc.Error{
                        Msg:  "[Flight SQL Statement] must call Prepare or set 
IngestTargetTable before calling Bind",
                        Code: adbc.StatusInvalidState}
        }
   
        // calls retain
        s.prepared.SetRecordReader(stream)
        return nil
   }
   ```
   
   The current non-patched code, raises the error:
   ```
   [Flight SQL Statement] must call Prepare or set IngestTargetTable before 
calling Bind
   ```


-- 
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