joellubi commented on code in PR #38385:
URL: https://github.com/apache/arrow/pull/38385#discussion_r1562954390


##########
go/arrow/flight/flightsql/client.go:
##########
@@ -243,6 +243,87 @@ func (c *Client) ExecuteSubstraitUpdate(ctx 
context.Context, plan SubstraitPlan,
        return updateResult.GetRecordCount(), nil
 }
 
+// ExecuteIngest is for executing a bulk ingestion and only returns the number 
of affected rows.
+// The provided RecordReader will be retained for the duration of the call, 
but it is the caller's
+// responsibility to release the original reference.
+func (c *Client) ExecuteIngest(ctx context.Context, rdr array.RecordReader, 
reqOptions *ExecuteIngestOpts, opts ...grpc.CallOption) (int64, error) {
+       var (
+               err          error
+               desc         *flight.FlightDescriptor
+               stream       pb.FlightService_DoPutClient
+               wr           *flight.Writer
+               res          *pb.PutResult
+               updateResult pb.DoPutUpdateResult
+       )
+
+       // Servers cannot infer defaults for these parameters, so we validate 
the request to ensure they are set.
+       if reqOptions.TableDefinitionOptions == nil {
+               return 0, fmt.Errorf("cannot ExecuteIngest: invalid 
ExecuteIngestOpts, TableDefinitionOptions is required")
+       }
+       if reqOptions.Table == "" {
+               return 0, fmt.Errorf("cannot ExecuteIngest: invalid 
ExecuteIngestOpts, Table is required")
+       }
+
+       rdr.Retain()
+       defer rdr.Release()

Review Comment:
   Good catch, updated



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