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-8938: [R] Provide binding for arrow::compute::CallFunction#7279
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
e7f1ec332106592a67b5dee9ac7f78a57aae966d142578be6File 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.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
| #' @include arrow-package.R | ||
| #' @title Arrow scalars | ||
| #' @usage NULL | ||
| #' @format NULL | ||
| #' @docType class | ||
| #' | ||
| #' @description A `Scalar` holds a single value of an Arrow type. | ||
| #' | ||
| #' @name Scalar | ||
| #' @rdname Scalar | ||
| #' @export | ||
| Scalar <- R6Class("Scalar", inherit = ArrowObject, | ||
| # TODO: document the methods | ||
| public = list( | ||
| ToString = function() Scalar__ToString(self), | ||
| cast = function(target_type) { | ||
| Scalar$create(Scalar__CastTo(self, as_type(target_type))) | ||
| }, | ||
| as_vector = function() Scalar__as_vector(self) | ||
| ), | ||
| active = list( | ||
| is_valid = function() Scalar__is_valid(self), | ||
| type = function() DataType$create(Scalar__type(self)) | ||
| ) | ||
| ) | ||
| Scalar$create <- function(x, type = NULL) { | ||
| if (!inherits(x, "externalptr")) { | ||
| if (is.null(x)) { | ||
| x <- vctrs::unspecified(1) | ||
| } else if (length(x) != 1 && !is.data.frame(x)) { | ||
| # Wrap in a list type | ||
| x <- list(x) | ||
| } | ||
| x <- Array__GetScalar(Array$create(x, type = type), 0) | ||
| } | ||
| shared_ptr(Scalar, x) | ||
| } | ||
| #' @export | ||
| length.Scalar <- function(x) 1L | ||
| #' @export | ||
| is.na.Scalar <- function(x) !x$is_valid | ||
| #' @export | ||
| as.vector.Scalar <- function(x, mode) x$as_vector() |
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.
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.
@wesm I didn't see a JIRA for this but admittedly there are a lot attached to the umbrella ticket so I may have missed it. Is there one for supporting Take with ChunkedArrays (as either the first and/or second argument)? Likewise for Take/Filter on RecordBatch and Table.
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.
https://issues.apache.org/jira/browse/ARROW-8976