Skip to content

Commit 0e1d509

Browse files
author
fotinosk
committed
feat(dict converter): add conversion for large bin and string
1 parent ddc4229 commit 0e1d509

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

cpp/src/arrow/util/converter.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,9 @@ struct MakeConverterImpl {
238238
DICTIONARY_CASE(FloatType);
239239
DICTIONARY_CASE(DoubleType);
240240
DICTIONARY_CASE(BinaryType);
241+
DICTIONARY_CASE(LargeBinaryType);
241242
DICTIONARY_CASE(StringType);
243+
DICTIONARY_CASE(LargeStringType);
242244
DICTIONARY_CASE(FixedSizeBinaryType);
243245
#undef DICTIONARY_CASE
244246
default:

python/pyarrow/src/arrow/python/python_to_arrow.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ class PyDictionaryConverter<U, enable_if_has_string_view<U>>
826826
} else {
827827
ARROW_RETURN_NOT_OK(
828828
PyValue::Convert(this->value_type_, this->options_, value, view_));
829-
return this->value_builder_->Append(view_.bytes, static_cast<int32_t>(view_.size));
829+
return this->value_builder_->Append(view_.bytes, static_cast<typename U::offset_type>(view_.size));
830830
}
831831
}
832832

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import pytest
2+
3+
import pyarrow as pa
4+
5+
6+
def test_arrow_missing_function():
7+
8+
pa.array([], pa.dictionary(pa.int32(), pa.string()))
9+
pa.array([], pa.dictionary(pa.int32(), pa.binary()))
10+
11+
pa.array([], pa.dictionary(pa.int32(), pa.large_string()))
12+
pa.array([], pa.dictionary(pa.int32(), pa.large_binary()))

0 commit comments

Comments
 (0)