Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 4.3k
ARROW-12105: [R] Replace vars_select, vars_rename with eval_select, eval_rename#14371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
ce5b9674b357262fcab49aa2ed7eb3663da7827b5086867e03396ad60bcf4b33d381b73b092c66d01a13991feb2c0b890a81967630e24c99a317245c5c76423711de88b686076a9122a5d37f1fFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -18,6 +18,7 @@ | ||
| #include "./arrow_types.h" | ||
| #include <arrow/array/array_base.h> | ||
| #include <arrow/builder.h> | ||
| #include <arrow/table.h> | ||
| #include <arrow/util/byte_size.h> | ||
| #include <arrow/util/key_value_metadata.h> | ||
| @@ -302,6 +303,37 @@ std::shared_ptr<arrow::Table> Table__from_record_batches( | ||
| return tab; | ||
| } | ||
| // [[arrow::export]] | ||
| std::shared_ptr<arrow::Table> Table__from_schema(SEXP schema_sxp) { | ||
nealrichardson marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| auto schema = cpp11::as_cpp<std::shared_ptr<arrow::Schema>>(schema_sxp); | ||
| int num_fields = schema->num_fields(); | ||
| std::vector<std::shared_ptr<arrow::Array>> columns; | ||
| for (int i = 0; i < num_fields; i++) { | ||
| bool is_extension_type = schema->field(i)->type()->name() == "extension"; | ||
| std::shared_ptr<arrow::DataType> type; | ||
| // need to handle extension types a bit differently | ||
| if (is_extension_type) { | ||
| // TODO: ARROW-18043 - update this to properly construct extension types instead of | ||
| // converting to null | ||
| type = arrow::null(); | ||
| } else { | ||
| type = schema->field(i)->type(); | ||
| } | ||
| std::shared_ptr<arrow::Array> array; | ||
| std::unique_ptr<arrow::ArrayBuilder> type_builder; | ||
| StopIfNotOk(arrow::MakeBuilder(gc_memory_pool(), type, &type_builder)); | ||
| StopIfNotOk(type_builder->Finish(&array)); | ||
| columns.push_back(array); | ||
| } | ||
| return (arrow::Table::Make(schema, std::move(columns))); | ||
| } | ||
| // [[arrow::export]] | ||
| r_vec_size Table__ReferencedBufferSize(const std::shared_ptr<arrow::Table>& table) { | ||
| return r_vec_size(ValueOrStop(arrow::util::ReferencedBufferSize(*table))); | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉