Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add api comment for arrow export #1941

Merged
merged 1 commit into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/include/c_api/kuzu.h
Original file line number Diff line number Diff line change
Expand Up @@ -495,18 +495,24 @@ KUZU_C_API void kuzu_query_result_write_to_csv(kuzu_query_result* query_result,
KUZU_C_API void kuzu_query_result_reset_iterator(kuzu_query_result* query_result);

/**
* @brief Returns the query result's schema as ArrowSchema.
* @praam query_result The query result instance to return.
* @return datatypes of the columns as an arrow schema
*
* It is the caller's responsibility to call the release function to release the underlying data
*/
struct ArrowSchema kuzu_query_result_get_arrow_schema(kuzu_query_result* query_result);
KUZU_C_API struct ArrowSchema kuzu_query_result_get_arrow_schema(kuzu_query_result* query_result);

/**
* @return An arrow array representation of the query result
* @brief Returns the next chunk of the query result as ArrowArray.
* @param query_result The query result instance to return.
* @param chunk_size The number of tuples to return in the chunk.
* @return An arrow array representation of the query result. The arrow array internally stores an
* arrow struct with fields for each of the columns.
*
* It is the caller's responsibility to call the release function to release the underlying data
*/
struct ArrowArray kuzu_query_result_get_next_arrow_chunk(
KUZU_C_API struct ArrowArray kuzu_query_result_get_next_arrow_chunk(
kuzu_query_result* query_result, int64_t chunk_size);

// FlatTuple
Expand Down
7 changes: 5 additions & 2 deletions src/include/main/query_result.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,17 @@ class QueryResult {
processor::FactorizedTable* getTable() { return factorizedTable.get(); }

/**
* @brief Returns the arrow schema of the query result.
* @return datatypes of the columns as an arrow schema
*
* It is the caller's responsibility to call the release function to release the underlying data
* If converting to another arrow type, this this is usually handled automatically.
*/
std::unique_ptr<ArrowSchema> getArrowSchema() const;
KUZU_API std::unique_ptr<ArrowSchema> getArrowSchema() const;

/**
* @brief Returns the next chunk of the query result as an arrow array.
* @param chunkSize number of tuples to return in the chunk.
* @return An arrow array representation of the next chunkSize tuples of the query result.
*
* The ArrowArray internally stores an arrow struct with fields for each of the columns.
Expand All @@ -114,7 +117,7 @@ class QueryResult {
* It is the caller's responsibility to call the release function to release the underlying data
* If converting to another arrow type, this this is usually handled automatically.
*/
std::unique_ptr<ArrowArray> getNextArrowChunk(int64_t chunkSize);
KUZU_API std::unique_ptr<ArrowArray> getNextArrowChunk(int64_t chunkSize);

private:
void initResultTableAndIterator(std::shared_ptr<processor::FactorizedTable> factorizedTable_,
Expand Down