Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-2091

Interacting with arrow/pyarrow in C++

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      I've been searching online for a while but cannot figure out how to do this. Please help if this is already a resolved issue.

      I have a c+/python application that interacts with arrow/pyarrow. I want to write a C+ api that takes python objects directly and operate on them in c++.

      PyObject* process_table(PyObject* table)
      {
          // process the arrow table
          std::shared_ptr<arrow::Table> tablePtr = table; // How?
      }

      The problem here is: how do I extract the internal std::shared_ptr<Table> from the PyObject?

      Unfortunately we are not using cython in our stack, we operate on PyObject * directly in c++.

      I can easily do this on numpy arrays:

      PyObject * process_array(PyObject* arr)
      {
          PyArray_Check(arr);
          // process the PyArrayObject directly
          ...
      }

      I wonder is there any way to achieve this level of c++ integration without using cython? Thanks!

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              fangandma Jun
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: