vibhatha commented on code in PR #14024: URL: https://github.com/apache/arrow/pull/14024#discussion_r967205466
########## python/pyarrow/_substrait.pyx: ########## @@ -17,22 +17,99 @@ # cython: language_level = 3 from cython.operator cimport dereference as deref +from libcpp.vector cimport vector as std_vector from pyarrow import Buffer -from pyarrow.lib import frombytes +from pyarrow.lib import frombytes, tobytes from pyarrow.lib cimport * from pyarrow.includes.libarrow cimport * from pyarrow.includes.libarrow_substrait cimport * -def run_query(plan): +cdef CDeclaration _create_named_table_provider(dict named_args, const std_vector[c_string]& names): + cdef: + c_string c_name + shared_ptr[CTable] c_in_table + shared_ptr[CTableSourceNodeOptions] c_tablesourceopts + shared_ptr[CExecNodeOptions] c_input_node_opts + vector[CDeclaration.Input] no_c_inputs + + py_names = [] + for i in range(names.size()): + c_name = names[i] + py_names.append(frombytes(c_name)) + + py_table = named_args["provider"](py_names) + c_in_table = pyarrow_unwrap_table(py_table) + c_tablesourceopts = make_shared[CTableSourceNodeOptions]( + c_in_table, 1 << 20) Review Comment: Oh yes, I missed that. -- 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]
