[
https://issues.apache.org/jira/browse/ARROW-16340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17613797#comment-17613797
]
Kouhei Sutou commented on ARROW-16340:
--------------------------------------
[~niyue] Thanks. How about using [the C data
interface|https://arrow.apache.org/docs/format/CDataInterface.html] / [the C
stream interface|https://arrow.apache.org/docs/format/CStreamInterface.html]
instead of {{arrow/python/pyarrow.h}}?
{code:cpp}
auto table = get_exec_context()->search(sql);
auto reader = arrow::tableBatchReader(table);
struct ArrowArrayStream c_stream;
auto status = arrow::ExportRecordBatchReader(reader, &c_stream); // TODO: Check
status
// Call the following Python code from pybind11 (sorry. I'm not familiar with
Python's C API):
// py_reader = pyarrow.ipc.RecordBatchReader._import_from_c(&c_stream);
// py_table = pyarrow.Table.from_batches(py_reader);
return pybind11::reinterpret_steal<pybind11::object>(py_table);
{code}
The C data interface and the C stream interface are included in Apache Arrow
C++.
> [C++][Python] Move all Python related code into PyArrow
> -------------------------------------------------------
>
> Key: ARROW-16340
> URL: https://issues.apache.org/jira/browse/ARROW-16340
> Project: Apache Arrow
> Issue Type: Improvement
> Components: C++, Python
> Reporter: Alenka Frim
> Assignee: Alenka Frim
> Priority: Major
> Labels: pull-request-available
> Fix For: 10.0.0
>
> Time Spent: 33h 10m
> Remaining Estimate: 0h
>
> Move {{src/arrow/python}} directory into {{pyarrow}} and arrange PyArrow to
> build it.
> More details can be found on this thread:
> https://lists.apache.org/thread/jbxyldhqff4p9z53whhs95y4jcomdgd2
--
This message was sent by Atlassian Jira
(v8.20.10#820010)