Re: Integration between ibis-substrait and Acero

2022-10-05 Thread Will Jones
Some of these issues may be fixed in ARROW-17915 [1]. [1] https://github.com/apache/arrow/pull/14295 On Wed, Oct 5, 2022 at 12:07 PM Will Jones wrote: > I can confirm that fixes that issue in the simple case. But if result is > either of these, we get an error: > > result = compiler.compile(t.s

Re: Integration between ibis-substrait and Acero

2022-10-05 Thread Will Jones
I can confirm that fixes that issue in the simple case. But if result is either of these, we get an error: result = compiler.compile(t.select("b")) # leads to: Traceback (most recent call last): File "", line 1, in File "pyarrow/_substrait.pyx", line 140, in pyarrow._substrait.run_query c

Re: Integration between ibis-substrait and Acero

2022-10-05 Thread Li Jin
Ok I think I got a working version now: t = ibis.table([("a", "int64"), ("b", "int64")], name="table0") test_table_0 = pa.Table.from_pydict({"a": [1, 2, 3], "b": [4, 5, 6]}) result = self.compiler.compile(t) def table_provider(names): if not name

Re: Integration between ibis-substrait and Acero

2022-10-05 Thread Li Jin
Hmm. Thanks for the update - Now I searched the code more, it seems perhaps I should be using "compile" rather than "translate"; https://github.com/ibis-project/ibis-substrait/blob/main/ibis_substrait/compiler/core.py#L82 Let me try some more On Wed, Oct 5, 2022 at 1:42 PM Will Jones wrote: >

Re: Integration between ibis-substrait and Acero

2022-10-05 Thread Will Jones
Hi Li Jin, The original segfault seems to occur because you are passing a Python bytes object and not a PyArrow Buffer object. You can wrap the bytes object using pa.py_buffer(): pa.substrait.run_query(pa.py_buffer(result_bytes), table_provider) That being said, when I run your full example wit

Re: Integration between ibis-substrait and Acero

2022-10-04 Thread Li Jin
For reference, this is the "relations" entry that I was referring to: https://github.com/apache/arrow/blob/master/python/pyarrow/tests/test_substrait.py#L186 On Tue, Oct 4, 2022 at 3:28 PM Li Jin wrote: > So I made some progress with updated code: > > t = ibis.table([("a", "int64"), ("b"

Re: Integration between ibis-substrait and Acero

2022-10-04 Thread Li Jin
So I made some progress with updated code: t = ibis.table([("a", "int64"), ("b", "int64")], name="table0") test_table_0 = pa.Table.from_pydict({"a": [1, 2, 3], "b": [4, 5, 6]}) result = translate(t, self.compiler) def table_provider(names): if no