Joris Van den Bossche created ARROW-16442:
---------------------------------------------

             Summary: [Python] The fragments for ORC dataset return base 
Fragment instead of FileFragment
                 Key: ARROW-16442
                 URL: https://issues.apache.org/jira/browse/ARROW-16442
             Project: Apache Arrow
          Issue Type: Bug
          Components: Python
            Reporter: Joris Van den Bossche
             Fix For: 9.0.0


>From https://github.com/dask/dask/pull/8944#issuecomment-1112620037

For the ORC file format, we return base {{Fragment}} objects instead of the 
{{FileFragment}} subclass (which has more functionality):

{code:python}
import pyarrow as pa
import pyarrow.dataset as ds
from pyarrow import orc

table = pa.table({'a': [1, 2, 3]})
orc.write_table(table, "test.orc")
dataset = ds.dataset("test.orc", format="orc")
fragment = list(dataset.get_fragments())[0]
{code}

{code}
In [9]: fragment
Out[9]: <pyarrow._dataset.Fragment at 0x7f97b159beb0>

In [10]: fragment.path
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-10-6477cc57f0cc> in <module>
----> 1 fragment.path

AttributeError: 'pyarrow._dataset.Fragment' object has no attribute 'path'
{code}



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to