wjones127 commented on code in PR #14286:
URL: https://github.com/apache/arrow/pull/14286#discussion_r995138972


##########
r/R/query-engine.R:
##########
@@ -384,3 +397,65 @@ needs_projection <- function(projection, schema) {
     !identical(field_names, names(projection)) || # Any fields are renamed
     !identical(field_names, names(schema)) # The fields are reordered
 }
+
+#' Create projection needed to coalesce join keys after a full outer join
+#'
+#' @examples
+#' test_join <- list(
+#'   type = JoinType$FULL_OUTER,
+#'   right_data = arrow_table(x = 1, y = 2, z = "x"),
+#'   by = c("x", "y"),
+#'   suffix = c(".x", ".y"),
+#'   keep = FALSE
+#' )
+#' post_join_projection(c("value", "x", "y", "z"), test_join)
+#'
+#' @noRd
+post_join_projection <- function(left_names, join_config) {
+  # Need to coalesce the key columns
+  right_names <- names(join_config$right_data)
+  # Collect mapping of which columns on left need to be coalesced with which
+  # column on the right side.
+  coalesce_targets <- data.frame(

Review Comment:
   I'm not sure how that would work. If there's something like a Python 
dictionary that can represent `Dict[int, int]` that would be nice. But it would 
only eliminate one line I think.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to