grundprinzip commented on code in PR #152:
URL: https://github.com/apache/spark-connect-go/pull/152#discussion_r2203499715


##########
spark/client/client.go:
##########
@@ -434,6 +443,151 @@ func (c *ExecutePlanClient) ToTable() (*types.StructType, 
arrow.Table, error) {
        }
 }
 
+func (c *ExecutePlanClient) ToRecordBatches(ctx context.Context) (<-chan 
arrow.Record, <-chan error, *types.StructType) {
+       recordChan := make(chan arrow.Record, 10)
+       errorChan := make(chan error, 1)
+
+       go func() {
+               defer func() {
+                       // Ensure channels are always closed to prevent 
goroutine leaks
+                       close(recordChan)
+                       close(errorChan)
+               }()
+
+               // Explicitly needed when tracking re-attachable execution.
+               c.done = false

Review Comment:
   re-attachable execution is optional, we need to make sure it works with both 
modes.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to