You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/09/14 17:27:31 UTC
[GitHub] [arrow] nealrichardson opened a new pull request #11155: [WIP] ARROW-13995: [R] Bindings for join node
nealrichardson opened a new pull request #11155:
URL: https://github.com/apache/arrow/pull/11155
This is based on #11150. The R test currently sometimes segfaults inside the join wrapper:
```
*** caught segfault ***
address 0x17, cause 'invalid permissions'
Traceback:
1: .Call(`_arrow_ExecNode_Join`, input, type, right_data, left_keys, right_keys, left_output, right_output)
```
sometimes just hangs, and sometimes fails with a cryptic `vector` error message that seems to be coming from the R bindings. I have not successfully evaluated a join, but I have sometimes made a join node (I suspect the hanging comes from when I run the ExecPlan with the join)
Among the issues observed, in addition to the behavior above:
* Dictionary columns aren't allowed even in the left data, and you can't first `Project` to remove them--that still is rejected.
* Duplicate column names aren't allowed at all, even though there is a provision for deduping with a prefix
* This duplicate column restriction also applies to the join keys, which very much may have the same names and should (usually) not be duplicated in the result
* It appears that the join node does not expose an `output_schema()` like other nodes do--it's empty. This was causing Project after Join to fail (I hacked around that in R just to see if I could get it to run) and possibly could be related to other problems.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] jonkeane closed pull request #11155: ARROW-13995: [R] Bindings for join node
Posted by GitBox <gi...@apache.org>.
jonkeane closed pull request #11155:
URL: https://github.com/apache/arrow/pull/11155
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] jonkeane commented on a change in pull request #11155: ARROW-13995: [R] Bindings for join node
Posted by GitBox <gi...@apache.org>.
jonkeane commented on a change in pull request #11155:
URL: https://github.com/apache/arrow/pull/11155#discussion_r717936771
##########
File path: r/tests/testthat/test-dplyr-join.R
##########
@@ -0,0 +1,108 @@
+# 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.
+
+skip_if_not_available("dataset")
+
+library(dplyr)
+
+left <- example_data
+# Error: Invalid: Dictionary type support for join output field is not yet implemented, output field reference: FieldRef.Name(fct) on left side of the join
+# (select(-fct) also solves this but remove once)
+left$fct <- NULL
+left$some_grouping <- rep(c(1, 2), 5)
+
+to_join <- tibble::tibble(
+ some_grouping = c(1, 2),
+ capital_letters = c("A", "B"),
+ another_column = TRUE
+)
+
+test_that("left_join", {
+ expect_dplyr_equal(
+ input %>%
+ left_join(to_join) %>%
+ collect(),
+ left
+ )
+})
+
+test_that("left_join `by` args", {
+ expect_dplyr_equal(
+ input %>%
+ left_join(to_join, by = "some_grouping") %>%
+ collect(),
+ left
+ )
+ expect_dplyr_equal(
+ input %>%
+ left_join(
+ to_join %>%
+ rename(the_grouping = some_grouping),
+ by = c(some_grouping = "the_grouping")
+ ) %>%
+ collect(),
+ left
+ )
+})
+
+# TODO: test duplicate col names
+# TODO: test invalid 'by'
+
+test_that("right_join", {
+ expect_dplyr_equal(
+ input %>%
+ right_join(to_join) %>%
+ collect(),
+ left
+ )
+})
+
+test_that("inner_join", {
+ expect_dplyr_equal(
+ input %>%
+ inner_join(to_join) %>%
+ collect(),
+ left
+ )
+})
+
+test_that("full_join", {
+ expect_dplyr_equal(
+ input %>%
+ full_join(to_join) %>%
+ collect(),
+ left
+ )
+})
+
+test_that("semi_join", {
+ expect_dplyr_equal(
+ input %>%
+ semi_join(to_join) %>%
+ collect(),
+ left
+ )
+})
+
+test_that("anti_join", {
+ expect_dplyr_equal(
+ input %>%
+ anti_join(to_join) %>%
+ collect(),
+ left
+ )
+})
Review comment:
I can do this when I rebase, but should we have tests for the error handling as well (e.g. columns named but not in `x` or `y`, etc.)?
##########
File path: r/R/dplyr-join.R
##########
@@ -0,0 +1,125 @@
+# 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.
+
+
+# The following S3 methods are registered on load if dplyr is present
+
+do_join <- function(x,
+ y,
+ by = NULL,
+ copy = FALSE,
+ suffix = c(".x", ".y"),
+ ...,
+ keep = FALSE,
+ na_matches,
+ join_type) {
+ # TODO: handle `copy` arg: ignore?
+ # TODO: handle `suffix` arg: Arrow does prefix
+ # TODO: handle `keep` arg: "Should the join keys from both ‘x’ and ‘y’ be preserved in the output?"
+ # TODO: handle `na_matches` arg
+ x <- as_adq(x)
+ y <- as_adq(y)
+ by <- handle_join_by(by, x, y)
+
+ x$join <- list(
+ type = JoinType[[join_type]],
+ right_data = y,
+ by = by
+ )
+ collapse.arrow_dplyr_query(x)
+}
+
+left_join.arrow_dplyr_query <- function(x,
+ y,
+ by = NULL,
+ copy = FALSE,
+ suffix = c(".x", ".y"),
+ ...,
+ keep = FALSE) {
+ do_join(x, y, by, copy, suffix, ..., keep = keep, join_type = "LEFT_OUTER")
+}
+left_join.Dataset <- left_join.ArrowTabular <- left_join.arrow_dplyr_query
+
+right_join.arrow_dplyr_query <- function(x,
+ y,
+ by = NULL,
+ copy = FALSE,
+ suffix = c(".x", ".y"),
+ ...,
+ keep = FALSE) {
+ do_join(x, y, by, copy, suffix, ..., keep = keep, join_type = "RIGHT_OUTER")
+}
+right_join.Dataset <- right_join.ArrowTabular <- right_join.arrow_dplyr_query
+
+inner_join.arrow_dplyr_query <- function(x,
+ y,
+ by = NULL,
+ copy = FALSE,
+ suffix = c(".x", ".y"),
+ ...,
+ keep = FALSE) {
+ do_join(x, y, by, copy, suffix, ..., keep = keep, join_type = "INNER")
+}
+inner_join.Dataset <- inner_join.ArrowTabular <- inner_join.arrow_dplyr_query
+
+full_join.arrow_dplyr_query <- function(x,
+ y,
+ by = NULL,
+ copy = FALSE,
+ suffix = c(".x", ".y"),
+ ...,
+ keep = FALSE) {
+ do_join(x, y, by, copy, suffix, ..., keep = keep, join_type = "FULL_OUTER")
+}
+full_join.Dataset <- full_join.ArrowTabular <- full_join.arrow_dplyr_query
+
+semi_join.arrow_dplyr_query <- function(x,
+ y,
+ by = NULL,
+ copy = FALSE,
+ suffix = c(".x", ".y"),
+ ...,
+ keep = FALSE) {
+ do_join(x, y, by, copy, suffix, ..., keep = keep, join_type = "LEFT_SEMI")
+}
+semi_join.Dataset <- semi_join.ArrowTabular <- semi_join.arrow_dplyr_query
+
+anti_join.arrow_dplyr_query <- function(x,
+ y,
+ by = NULL,
+ copy = FALSE,
+ suffix = c(".x", ".y"),
+ ...,
+ keep = FALSE) {
+ do_join(x, y, by, copy, suffix, ..., keep = keep, join_type = "LEFT_ANTI")
+}
+anti_join.Dataset <- anti_join.ArrowTabular <- anti_join.arrow_dplyr_query
+
+handle_join_by <- function(by, x, y) {
+ if (is.null(by)) {
+ return(set_names(intersect(names(x), names(y))))
+ }
+ stopifnot(is.character(by))
Review comment:
This is not a comment on this code, but it never occurred to me that it's a bit funny that `by` isn't tidy-evaled and must be character strings (in dplyr!)
##########
File path: r/tests/testthat/test-dplyr-join.R
##########
@@ -0,0 +1,108 @@
+# 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.
+
+skip_if_not_available("dataset")
+
+library(dplyr)
+
+left <- example_data
+# Error: Invalid: Dictionary type support for join output field is not yet implemented, output field reference: FieldRef.Name(fct) on left side of the join
Review comment:
```suggestion
# Error: Invalid: Dictionary type support for join output field
# is not yet implemented, output field reference: FieldRef.Name(fct)
# on left side of the join
```
##########
File path: r/tests/testthat/test-dplyr-join.R
##########
@@ -0,0 +1,108 @@
+# 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.
+
+skip_if_not_available("dataset")
+
+library(dplyr)
+
+left <- example_data
+# Error: Invalid: Dictionary type support for join output field is not yet implemented, output field reference: FieldRef.Name(fct) on left side of the join
+# (select(-fct) also solves this but remove once)
+left$fct <- NULL
+left$some_grouping <- rep(c(1, 2), 5)
+
+to_join <- tibble::tibble(
+ some_grouping = c(1, 2),
+ capital_letters = c("A", "B"),
+ another_column = TRUE
+)
+
+test_that("left_join", {
+ expect_dplyr_equal(
+ input %>%
+ left_join(to_join) %>%
+ collect(),
+ left
+ )
+})
+
+test_that("left_join `by` args", {
+ expect_dplyr_equal(
+ input %>%
+ left_join(to_join, by = "some_grouping") %>%
+ collect(),
+ left
+ )
+ expect_dplyr_equal(
+ input %>%
+ left_join(
+ to_join %>%
+ rename(the_grouping = some_grouping),
+ by = c(some_grouping = "the_grouping")
+ ) %>%
+ collect(),
Review comment:
```suggestion
input %>%
rename(the_grouping = some_grouping) %>%
left_join(
to_join
by = c(the_grouping = "some_grouping")
) %>%
collect(),
```
This reads slightly easier to me, unless you were also intending to test the execution order of having a pipeline as the `y` argument of the join?
##########
File path: r/R/dplyr-join.R
##########
@@ -0,0 +1,125 @@
+# 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.
+
+
+# The following S3 methods are registered on load if dplyr is present
+
+do_join <- function(x,
+ y,
+ by = NULL,
+ copy = FALSE,
+ suffix = c(".x", ".y"),
+ ...,
+ keep = FALSE,
+ na_matches,
+ join_type) {
+ # TODO: handle `copy` arg: ignore?
+ # TODO: handle `suffix` arg: Arrow does prefix
+ # TODO: handle `keep` arg: "Should the join keys from both ‘x’ and ‘y’ be preserved in the output?"
+ # TODO: handle `na_matches` arg
+ x <- as_adq(x)
+ y <- as_adq(y)
+ by <- handle_join_by(by, x, y)
+
+ x$join <- list(
+ type = JoinType[[join_type]],
+ right_data = y,
+ by = by
+ )
+ collapse.arrow_dplyr_query(x)
+}
+
+left_join.arrow_dplyr_query <- function(x,
+ y,
+ by = NULL,
+ copy = FALSE,
+ suffix = c(".x", ".y"),
+ ...,
+ keep = FALSE) {
+ do_join(x, y, by, copy, suffix, ..., keep = keep, join_type = "LEFT_OUTER")
+}
+left_join.Dataset <- left_join.ArrowTabular <- left_join.arrow_dplyr_query
+
+right_join.arrow_dplyr_query <- function(x,
+ y,
+ by = NULL,
+ copy = FALSE,
+ suffix = c(".x", ".y"),
+ ...,
+ keep = FALSE) {
+ do_join(x, y, by, copy, suffix, ..., keep = keep, join_type = "RIGHT_OUTER")
+}
+right_join.Dataset <- right_join.ArrowTabular <- right_join.arrow_dplyr_query
+
+inner_join.arrow_dplyr_query <- function(x,
+ y,
+ by = NULL,
+ copy = FALSE,
+ suffix = c(".x", ".y"),
+ ...,
+ keep = FALSE) {
+ do_join(x, y, by, copy, suffix, ..., keep = keep, join_type = "INNER")
+}
+inner_join.Dataset <- inner_join.ArrowTabular <- inner_join.arrow_dplyr_query
+
+full_join.arrow_dplyr_query <- function(x,
+ y,
+ by = NULL,
+ copy = FALSE,
+ suffix = c(".x", ".y"),
+ ...,
+ keep = FALSE) {
+ do_join(x, y, by, copy, suffix, ..., keep = keep, join_type = "FULL_OUTER")
+}
+full_join.Dataset <- full_join.ArrowTabular <- full_join.arrow_dplyr_query
+
+semi_join.arrow_dplyr_query <- function(x,
+ y,
+ by = NULL,
+ copy = FALSE,
+ suffix = c(".x", ".y"),
+ ...,
+ keep = FALSE) {
+ do_join(x, y, by, copy, suffix, ..., keep = keep, join_type = "LEFT_SEMI")
+}
+semi_join.Dataset <- semi_join.ArrowTabular <- semi_join.arrow_dplyr_query
+
+anti_join.arrow_dplyr_query <- function(x,
+ y,
+ by = NULL,
+ copy = FALSE,
+ suffix = c(".x", ".y"),
+ ...,
+ keep = FALSE) {
+ do_join(x, y, by, copy, suffix, ..., keep = keep, join_type = "LEFT_ANTI")
+}
+anti_join.Dataset <- anti_join.ArrowTabular <- anti_join.arrow_dplyr_query
+
+handle_join_by <- function(by, x, y) {
+ if (is.null(by)) {
+ return(set_names(intersect(names(x), names(y))))
+ }
+ stopifnot(is.character(by))
Review comment:
It makes sense for the `by = c(col_x = "col_y")` interface, but a bit(?) odd for `by = "col"` case
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] nealrichardson commented on a change in pull request #11155: ARROW-13995: [R] Bindings for join node
Posted by GitBox <gi...@apache.org>.
nealrichardson commented on a change in pull request #11155:
URL: https://github.com/apache/arrow/pull/11155#discussion_r718487835
##########
File path: r/tests/testthat/test-dplyr-join.R
##########
@@ -0,0 +1,108 @@
+# 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.
+
+skip_if_not_available("dataset")
+
+library(dplyr)
+
+left <- example_data
+# Error: Invalid: Dictionary type support for join output field is not yet implemented, output field reference: FieldRef.Name(fct) on left side of the join
+# (select(-fct) also solves this but remove once)
+left$fct <- NULL
+left$some_grouping <- rep(c(1, 2), 5)
+
+to_join <- tibble::tibble(
+ some_grouping = c(1, 2),
+ capital_letters = c("A", "B"),
+ another_column = TRUE
+)
+
+test_that("left_join", {
+ expect_dplyr_equal(
+ input %>%
+ left_join(to_join) %>%
+ collect(),
+ left
+ )
+})
+
+test_that("left_join `by` args", {
+ expect_dplyr_equal(
+ input %>%
+ left_join(to_join, by = "some_grouping") %>%
+ collect(),
+ left
+ )
+ expect_dplyr_equal(
+ input %>%
+ left_join(
+ to_join %>%
+ rename(the_grouping = some_grouping),
+ by = c(some_grouping = "the_grouping")
+ ) %>%
+ collect(),
+ left
+ )
+})
+
+# TODO: test duplicate col names
+# TODO: test invalid 'by'
+
+test_that("right_join", {
+ expect_dplyr_equal(
+ input %>%
+ right_join(to_join) %>%
+ collect(),
+ left
+ )
+})
+
+test_that("inner_join", {
+ expect_dplyr_equal(
+ input %>%
+ inner_join(to_join) %>%
+ collect(),
+ left
+ )
+})
+
+test_that("full_join", {
+ expect_dplyr_equal(
+ input %>%
+ full_join(to_join) %>%
+ collect(),
+ left
+ )
+})
+
+test_that("semi_join", {
+ expect_dplyr_equal(
+ input %>%
+ semi_join(to_join) %>%
+ collect(),
+ left
+ )
+})
+
+test_that("anti_join", {
+ expect_dplyr_equal(
+ input %>%
+ anti_join(to_join) %>%
+ collect(),
+ left
+ )
+})
Review comment:
Oh yeah, there are lots of missing tests, and these datasets aren't ideal for testing joins. We may want to just use the datasets that dplyr uses in its tests or something.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] github-actions[bot] removed a comment on pull request #11155: [WIP] ARROW-13995: [R] Bindings for join node
Posted by GitBox <gi...@apache.org>.
github-actions[bot] removed a comment on pull request #11155:
URL: https://github.com/apache/arrow/pull/11155#issuecomment-919362405
<!--
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.
-->
Thanks for opening a pull request!
If this is not a [minor PR](https://github.com/apache/arrow/blob/master/CONTRIBUTING.md#Minor-Fixes). Could you open an issue for this pull request on JIRA? https://issues.apache.org/jira/browse/ARROW
Opening JIRAs ahead of time contributes to the [Openness](http://theapacheway.com/open/#:~:text=Openness%20allows%20new%20users%20the,must%20happen%20in%20the%20open.) of the Apache Arrow project.
Then could you also rename pull request title in the following format?
ARROW-${JIRA_ID}: [${COMPONENT}] ${SUMMARY}
or
MINOR: [${COMPONENT}] ${SUMMARY}
See also:
* [Other pull requests](https://github.com/apache/arrow/pulls/)
* [Contribution Guidelines - How to contribute patches](https://arrow.apache.org/docs/developers/contributing.html#how-to-contribute-patches)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] nealrichardson commented on a change in pull request #11155: ARROW-13995: [R] Bindings for join node
Posted by GitBox <gi...@apache.org>.
nealrichardson commented on a change in pull request #11155:
URL: https://github.com/apache/arrow/pull/11155#discussion_r718487835
##########
File path: r/tests/testthat/test-dplyr-join.R
##########
@@ -0,0 +1,108 @@
+# 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.
+
+skip_if_not_available("dataset")
+
+library(dplyr)
+
+left <- example_data
+# Error: Invalid: Dictionary type support for join output field is not yet implemented, output field reference: FieldRef.Name(fct) on left side of the join
+# (select(-fct) also solves this but remove once)
+left$fct <- NULL
+left$some_grouping <- rep(c(1, 2), 5)
+
+to_join <- tibble::tibble(
+ some_grouping = c(1, 2),
+ capital_letters = c("A", "B"),
+ another_column = TRUE
+)
+
+test_that("left_join", {
+ expect_dplyr_equal(
+ input %>%
+ left_join(to_join) %>%
+ collect(),
+ left
+ )
+})
+
+test_that("left_join `by` args", {
+ expect_dplyr_equal(
+ input %>%
+ left_join(to_join, by = "some_grouping") %>%
+ collect(),
+ left
+ )
+ expect_dplyr_equal(
+ input %>%
+ left_join(
+ to_join %>%
+ rename(the_grouping = some_grouping),
+ by = c(some_grouping = "the_grouping")
+ ) %>%
+ collect(),
+ left
+ )
+})
+
+# TODO: test duplicate col names
+# TODO: test invalid 'by'
+
+test_that("right_join", {
+ expect_dplyr_equal(
+ input %>%
+ right_join(to_join) %>%
+ collect(),
+ left
+ )
+})
+
+test_that("inner_join", {
+ expect_dplyr_equal(
+ input %>%
+ inner_join(to_join) %>%
+ collect(),
+ left
+ )
+})
+
+test_that("full_join", {
+ expect_dplyr_equal(
+ input %>%
+ full_join(to_join) %>%
+ collect(),
+ left
+ )
+})
+
+test_that("semi_join", {
+ expect_dplyr_equal(
+ input %>%
+ semi_join(to_join) %>%
+ collect(),
+ left
+ )
+})
+
+test_that("anti_join", {
+ expect_dplyr_equal(
+ input %>%
+ anti_join(to_join) %>%
+ collect(),
+ left
+ )
+})
Review comment:
Oh yeah, there are lots of missing tests, and these datasets aren't ideal for testing joins. We may want to just use the datasets that dplyr uses in its tests or something.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] github-actions[bot] commented on pull request #11155: [WIP] ARROW-13995: [R] Bindings for join node
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #11155:
URL: https://github.com/apache/arrow/pull/11155#issuecomment-919362405
<!--
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.
-->
Thanks for opening a pull request!
If this is not a [minor PR](https://github.com/apache/arrow/blob/master/CONTRIBUTING.md#Minor-Fixes). Could you open an issue for this pull request on JIRA? https://issues.apache.org/jira/browse/ARROW
Opening JIRAs ahead of time contributes to the [Openness](http://theapacheway.com/open/#:~:text=Openness%20allows%20new%20users%20the,must%20happen%20in%20the%20open.) of the Apache Arrow project.
Then could you also rename pull request title in the following format?
ARROW-${JIRA_ID}: [${COMPONENT}] ${SUMMARY}
or
MINOR: [${COMPONENT}] ${SUMMARY}
See also:
* [Other pull requests](https://github.com/apache/arrow/pulls/)
* [Contribution Guidelines - How to contribute patches](https://arrow.apache.org/docs/developers/contributing.html#how-to-contribute-patches)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow] github-actions[bot] commented on pull request #11155: ARROW-13995: [R] Bindings for join node
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #11155:
URL: https://github.com/apache/arrow/pull/11155#issuecomment-923185049
https://issues.apache.org/jira/browse/ARROW-13995
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org