Skip to content

Commit 2067d76

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

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <limits>
2525
#include <sstream>
2626
#include <string>
27+
#include <string_view>
2728
#include <utility>
2829
#include <vector>
2930

@@ -826,7 +827,17 @@ class PyDictionaryConverter<U, enable_if_has_string_view<U>>
826827
} else {
827828
ARROW_RETURN_NOT_OK(
828829
PyValue::Convert(this->value_type_, this->options_, value, view_));
829-
return this->value_builder_->Append(view_.bytes, static_cast<typename U::offset_type>(view_.size));
830+
// return this->value_builder_->Append(view_.bytes, static_cast<typename U::offset_type>(view_.size));
831+
832+
// if constexpr (
833+
// std::is_same<U, arrow::LargeStringType>::value ||
834+
// std::is_same<U, arrow::LargeBinaryType>::value) {
835+
// return this->value_builder_->Append(view_.bytes, static_cast<int64_t>(view_.size));
836+
// } else {
837+
// return this->value_builder_->Append(view_.bytes, static_cast<int32_t>(view_.size));
838+
// }
839+
840+
return this->value_builder_->Append(std::string_view(view_.bytes, view_.size));
830841
}
831842
}
832843

0 commit comments

Comments
 (0)