zeroshade commented on code in PR #39575:
URL: https://github.com/apache/arrow/pull/39575#discussion_r1457864879
##########
go/arrow/flight/flightsql/client.go:
##########
@@ -981,6 +1027,48 @@ func (p *PreparedStatement) Execute(ctx context.Context,
opts ...grpc.CallOption
return p.client.getFlightInfo(ctx, desc, opts...)
}
+// ExecutePoll executes the prepared statement on the server and returns a
PollInfo
+// indicating the progress of execution.
+//
+// Will error if already closed.
+func (p *PreparedStatement) ExecutePoll(ctx context.Context, retryDescriptor
*flight.FlightDescriptor, opts ...grpc.CallOption) (*flight.PollInfo, error) {
+ if p.closed {
+ return nil, errors.New("arrow/flightsql: prepared statement
already closed")
+ }
+
+ cmd := &pb.CommandPreparedStatementQuery{PreparedStatementHandle:
p.handle}
+
+ desc, err := descForCommand(cmd)
+ if err != nil {
+ return nil, err
+ }
+
+ if retryDescriptor == nil {
+ if p.hasBindParameters() {
+ pstream, err := p.client.Client.DoPut(ctx, opts...)
+ if err != nil {
+ return nil, err
+ }
+
+ wr, err := p.writeBindParameters(pstream, desc)
+ if err != nil {
+ return nil, err
+ }
+ if err = wr.Close(); err != nil {
+ return nil, err
+ }
+ pstream.CloseSend()
+
+ // wait for the server to ack the result
+ if _, err = pstream.Recv(); err != nil && err != io.EOF
{
+ return nil, err
+ }
Review Comment:
didn't we have a helper function that did this?
--
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]