lidavidm commented on issue #61:
URL: https://github.com/apache/arrow-adbc/issues/61#issuecomment-1217131457

   Ok, while digging I realized we also need to account for partitioning 
(=Flight/Flight SQL's ability to return multiple endpoints in a GetFlightInfo). 
So what I'm tentatively about to refactor towards is this:
   
   ```c
   /// \brief Execute a statement and get the results.
   ///
   /// This invalidates any prior result sets.
   ///
   /// \param[in] statement The statement to execute.
   /// \param[in] out_type The expected result type:
   ///   - ADBC_OUTPUT_TYPE_NONE if the query should not generate a
   ///     result set;
   ///   - ADBC_OUTPUT_TYPE_ARROW for an ArrowArrayStream;
   ///   - ADBC_OUTPUT_TYPE_PARTITIONS for a count of partitions (see \ref
   ///     adbc-statement-partition below).
   ///   The result set will be in out.
   /// \param[out] out The results. Must be NULL for output type NONE, a
   ///   pointer to an ArrowArrayStream for ARROW_ARRAY_STREAM, or a
   ///   pointer to a size_t for PARTITIONS.
   /// \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.
   ADBC_EXPORT
   AdbcStatusCode AdbcStatementExecute(struct AdbcStatement* statement, int 
output_type,
                                       void* out, int64_t* rows_affected,
                                       struct AdbcError* error);
   
   /// \brief No results are expected from AdbcStatementExecute.  Pass
   ///   NULL to out.
   #define ADBC_OUTPUT_TYPE_NONE 0
   /// \brief Arrow data is expected from AdbcStatementExecute.  Pass
   ///   ArrowArrayStream* to out.
   #define ADBC_OUTPUT_TYPE_ARROW 1
   /// \brief Partitions are expected from AdbcStatementExecute.  Pass
   ///   size_t* to out to get the number of partitions, and use
   ///   AdbcStatementGetPartitionDesc to get a partition.
   ///
   /// Drivers are not required to support partitioning.  In that case,
   /// AdbcStatementExecute will return ADBC_STATUS_NOT_IMPLEMENTED.
   #define ADBC_OUTPUT_TYPE_PARTITIONS 2
   ```
   
   _If_ we decide to add native support for "affected row IDs", that could also 
go here. Otherwise I don't expect that we'd need more enum variants here.


-- 
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: issues-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to