lidavidm commented on code in PR #3607:
URL: https://github.com/apache/arrow-adbc/pull/3607#discussion_r2454020974


##########
c/include/arrow-adbc/adbc.h:
##########
@@ -2013,6 +2181,74 @@ AdbcStatusCode AdbcStatementExecuteQuery(struct 
AdbcStatement* statement,
                                          struct ArrowArrayStream* out,
                                          int64_t* rows_affected, struct 
AdbcError* error);
 
+/// \brief Retrieve the next result set from a multi-statement execution
+///
+/// This invalidates any prior result sets.  This AdbcStatement must
+/// outlive the returned ArrowArrayStream.
+///
+/// \since ADBC API revision 1.2.0
+///
+/// \param[in] statement The statement to retrieve the next result set from.
+/// \param[out] out The results. Pass NULL if the client does not
+///   expect a result set.
+/// \param[out] rows_affected The number of rows affected if known,
+///   else -1. Pass NULL if the client does not want this information.
+/// \param[out] error An optional location to return an error
+///   message if necessary.
+///
+/// \return ADBC_STATUS_NOT_IMPLEMENTED if the driver does not support
+///   multi-result set execution, ADBC_STATUS_OK if next result set is
+///   being returned successfully.  ADBC_STATUS_NOT_FOUND is returned
+///   when there are no more result sets.
+ADBC_EXPORT
+AdbcStatusCode AdbcStatementNextResultSet(struct AdbcStatement* statement,
+                                          struct ArrowArrayStream* out,
+                                          int64_t* rows_affected,
+                                          struct AdbcError* error);
+
+/// \brief Execute a statement asynchronously and get the results.
+///
+/// This will invalidate any prior result sets.  This AdbcStatement must
+/// outlive the returned ArrowAsyncDeviceStreamHandler.
+///
+/// \since ADBC API revision 1.2.0
+///
+/// \param[in] statement The statement to execute.
+/// \param[in] handler The async stream handler whose callbacks to use
+///   to deliver results.
+/// \param[out] rows_affected The number of rows affected if known, else -1. 
Pass
+///   NULL if the client does not want this information.
+/// \param[out] error An optional location to return an error message if 
necessary.
+///
+/// \return ADBC_STATUS_NOT_IMPLEMENTED if the driver does not support async 
execution,
+///   ADBC_STATUS_OK if the execution has started successfully.
+ADBC_EXPORT
+AdbcStatusCode AdbcStatementExecuteQueryAsync(
+    struct AdbcStatement* statement, struct ArrowAsyncDeviceStreamHandler* 
handler,
+    int64_t* rows_affected, struct AdbcError* error);

Review Comment:
   When would `rows_affected` be populated? Maybe it should be included in 
schema metadata or something instead...



##########
c/include/arrow-adbc/adbc.h:
##########
@@ -1939,6 +2081,32 @@ AdbcStatusCode AdbcConnectionReadPartition(struct 
AdbcConnection* connection,
                                            struct ArrowArrayStream* out,
                                            struct AdbcError* error);
 
+/// \brief Asynchronously read a partition of a query. The results can
+///   then be read independently.
+///
+/// A partition can be retrieved from AdbcPartitions.
+///
+/// This AdbcConnection must outlive the ArrowAsyncDeviceStreamHandler.

Review Comment:
   I think we need to comment on the lifetime of `serialized_partition` too - 
does it need to live until the call returns or until the callback finishes?



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