amoeba commented on issue #39273:
URL: https://github.com/apache/arrow/issues/39273#issuecomment-1865334304
It makes sense to me to make this work automatically. The analogous call in
PyArrow does, for example:
```python
In [26]: pdf
Out[26]:
letters
0 A
1 B
2 C
In [27]: pa.Table.from_pandas(pdf, schema = pa.schema([('letters',
pa.dictionary(pa.int64
...: (), pa.string()))]))
Out[27]:
pyarrow.Table
letters: dictionary<values=string, indices=int64, ordered=0>
----
letters: [ -- dictionary:
["A","B","C"] -- indices:
[0,1,2]]
```
It looks like the R package has [separate and internal conversion
machinery](https://github.com/apache/arrow/blob/main/r/src/r_to_arrow.cpp) from
PyArrow which uses the [Arrow C++ conversion
utility](https://github.com/apache/arrow/blob/main/cpp/src/arrow/util/converter.h).
Interestingly, the R conversion machinery was added after the C++/Python
pieces were added.
Would it be possible to do the conversion in `r_to_arrow.cpp`?
--
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]