CurtHagenlocher commented on issue #1358:
URL: https://github.com/apache/arrow-adbc/issues/1358#issuecomment-2299305322
Support for this will need to contend with three distinct consumption
possibilities which correspond to `AdbcStatementExecuteQuery`,
`AdbcStatementExecutePartitions`, and `AdbcStatementExecuteSchema`. Here's an
opening bid for an API that supports all three:
```
#define ADBC_STATUS_COMPLETE 15
AdbcStatusCode AdbcStatementNextResult(
struct AdbcStatement* statement,
struct ArrowSchema* schema,
struct ArrowArrayStream* out,
struct AdbcPartitions* partitions,
int64_t* rows_affected,
struct AdbcError* error);
```
A driver may support `AdbcStatementNextResult` while the previous result is
still being consumed. A driver which does not must return
`ADBC_STATUS_INVALID_STATE` while previous results are still being read. A
driver must return `ADBC_STATUS_COMPLETE` if there are no more results to be
read. This must not return an error.
If the original execution was via `AdbcStatementExecuteSchema`, then the
contents of `out`, `partitions` and `rows_affected` are unchanged and the
schema of the next result are placed into `schema`.
Either `partitions` or `out` must be null to indicate which style of output
is desired by the caller. Supplying both (or supplying either when doing a
schema-only evaluation) must result in `ADBC_STATUS_INVALID_ARGUMENT`. If the
original execution was via `AdbcStatementExecuteQuery` and the call to
`AdbcStatementNextResult` has a valid `partitions` or if the original execution
was via `AdbcStatementExecutePartitions` and the call has instead suppled `out`
then the driver may choose to return the data in a different style than the
original result set. If it does not (or cannot) then the driver must return
`ADBC_STATUS_INVALID_ARGUMENT`.
--
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]