Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cpp/src/arrow/util/converter.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ struct MakeConverterImpl {
DICTIONARY_CASE(DoubleType);
DICTIONARY_CASE(BinaryType);
DICTIONARY_CASE(StringType);
DICTIONARY_CASE(StringViewType);
DICTIONARY_CASE(FixedSizeBinaryType);
#undef DICTIONARY_CASE
default:
Expand Down
3 changes: 2 additions & 1 deletion python/pyarrow/src/arrow/python/python_to_arrow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,8 @@ class PyDictionaryConverter<U, enable_if_has_string_view<U>>
} else {
ARROW_RETURN_NOT_OK(
PyValue::Convert(this->value_type_, this->options_, value, view_));
return this->value_builder_->Append(view_.bytes, static_cast<int32_t>(view_.size));
return this->value_builder_->Append(
std::string_view(view_.bytes, static_cast<size_t>(view_.size)));
Comment on lines +829 to +830
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old code passed (const char*, int32_t) which matches StringBuilder::Append but not StringViewBuilder::Append (which takes int64_t). Switching to std::string_view works for both builder types.

}
}

Expand Down
2 changes: 1 addition & 1 deletion r/DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ Imports:
utils,
vctrs
Roxygen: list(markdown = TRUE, r6 = FALSE, load = "source")
RoxygenNote: 7.3.3
Config/testthat/edition: 3
Config/build/bootstrap: TRUE
Suggests:
Expand Down Expand Up @@ -152,3 +151,4 @@ Collate:
'schema.R'
'udf.R'
'util.R'
Config/roxygen2/version: 8.0.0
1 change: 1 addition & 0 deletions r/NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ export(set_io_thread_count)
export(show_exec_plan)
export(starts_with)
export(string)
export(string_view)
export(struct)
export(time32)
export(time64)
Expand Down
21 changes: 12 additions & 9 deletions r/R/arrowExports.R

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions r/R/type.R
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,13 @@ Utf8 <- R6Class(
code = function(namespace = FALSE) call2("utf8", .ns = if (namespace) "arrow")
)
)
StringView <- R6Class(
"StringView",
inherit = DataType,
public = list(
code = function(namespace = FALSE) call2("string_view", .ns = if (namespace) "arrow")
)
)
LargeUtf8 <- R6Class(
"LargeUtf8",
inherit = DataType,
Expand Down Expand Up @@ -505,6 +512,10 @@ bool <- boolean
#' @export
utf8 <- function() Utf8__initialize()

#' @rdname data-type
#' @export
string_view <- function() StringView__initialize()

#' @rdname data-type
#' @export
large_utf8 <- function() LargeUtf8__initialize()
Expand Down Expand Up @@ -806,6 +817,8 @@ canonical_type_str <- function(type_str) {
boolean = "bool",
bool = "bool",
utf8 = "string",
utf8_view = "string_view",
string_view = "string_view",
large_utf8 = "large_string",
large_string = "large_string",
binary = "binary",
Expand Down
4 changes: 2 additions & 2 deletions r/man/CsvReadOptions.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions r/man/JsonFileFormat.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading