paleolimbot commented on issue #39038:
URL: https://github.com/apache/arrow/issues/39038#issuecomment-1875684704

   I dug into this a little, and don't think this is a problem with arrow. One 
of the inputs has a somewhat strange column type of `structure(numeric(), class 
= NA_character_)`, and joining on that column is not going to work:
   
   ``` r
   library(arrow, warn.conflicts = FALSE)
   #> Some features are not enabled in this build of Arrow. Run `arrow_info()` 
for more information.
   library(dplyr, warn.conflicts = FALSE)
   
   strange_object <- numeric()
   class(strange_object) <- NA_character_
   
   df <- data.frame(strange_object)
   df |> 
     as_arrow_table() |> 
     full_join(df)
   #> Error in `map_chr()` at r/R/dplyr.R:122:2:
   #> ℹ In index: 1.
   #> ℹ With name: strange_object.
   #> Caused by error:
   #> ! NotImplemented: Function 'coalesce' has no kernel matching input types 
(numeric(0)
   #> attr(,"class")
   #> [1] NA, numeric(0)
   #> attr(,"class")
   #> [1] NA)
   #> Backtrace:
   #>      ▆
   #>   1. ├─base::tryCatch(...)
   #>   2. │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
   #>   3. │   ├─base (local) tryCatchOne(...)
   #>   4. │   │ └─base (local) doTryCatch(return(expr), name, parentenv, 
handler)
   #>   5. │   └─base (local) tryCatchList(expr, names[-nh], parentenv, 
handlers[-nh])
   #>   6. │     └─base (local) tryCatchOne(expr, names, parentenv, 
handlers[[1L]])
   #>   7. │       └─base (local) doTryCatch(return(expr), name, parentenv, 
handler)
   #>   8. ├─base::withCallingHandlers(...)
   #>   9. ├─base::saveRDS(...)
   #>  10. ├─base::do.call(...)
   #>  11. ├─base (local) `<fn>`(...)
   #>  12. ├─global `<fn>`(input = base::quote("next-esok_reprex.R"))
   #>  13. │ └─rmarkdown::render(input, quiet = TRUE, envir = globalenv(), 
encoding = "UTF-8")
   #>  14. │   └─knitr::knit(knit_input, knit_output, envir = envir, quiet = 
quiet)
   #>  15. │     └─knitr:::process_file(text, output)
   #>  16. │       ├─knitr:::handle_error(...)
   #>  17. │       │ └─base::withCallingHandlers(...)
   #>  18. │       ├─base::withCallingHandlers(...)
   #>  19. │       ├─knitr:::process_group(group)
   #>  20. │       └─knitr:::process_group.block(group)
   #>  21. │         └─knitr:::call_block(x)
   #>  22. │           └─knitr:::block_exec(params)
   #>  23. │             └─knitr:::eng_r(options)
   #>  24. │               ├─knitr:::in_input_dir(...)
   #>  25. │               │ └─knitr:::in_dir(input_dir(), expr)
   #>  26. │               └─knitr (local) evaluate(...)
   #>  27. │                 └─evaluate::evaluate(...)
   #>  28. │                   └─evaluate:::evaluate_call(...)
   #>  29. │                     ├─evaluate (local) handle(...)
   #>  30. │                     │ └─base::try(f, silent = TRUE)
   #>  31. │                     │   └─base::tryCatch(...)
   #>  32. │                     │     └─base (local) tryCatchList(expr, 
classes, parentenv, handlers)
   #>  33. │                     │       └─base (local) tryCatchOne(expr, 
names, parentenv, handlers[[1L]])
   #>  34. │                     │         └─base (local) 
doTryCatch(return(expr), name, parentenv, handler)
   #>  35. │                     ├─base::withCallingHandlers(...)
   #>  36. │                     ├─base::withVisible(value_fun(ev$value, 
ev$visible))
   #>  37. │                     └─knitr (local) value_fun(ev$value, ev$visible)
   #>  38. │                       └─knitr (local) fun(x, options = options)
   #>  39. │                         ├─base::withVisible(knit_print(x, ...))
   #>  40. │                         ├─knitr::knit_print(x, ...)
   #>  41. │                         └─knitr:::knit_print.default(x, ...)
   #>  42. │                           └─evaluate (local) normal_print(x)
   #>  43. │                             ├─base::print(x)
   #>  44. │                             └─arrow:::print.arrow_dplyr_query(x)
   #>  45. │                               └─purrr::map_chr(...) at 
r/R/dplyr.R:122:2
   #>  46. │                                 └─purrr:::map_("character", .x, 
.f, ..., .progress = .progress)
   #>  47. │                                   
├─purrr:::with_indexed_errors(...)
   #>  48. │                                   │ 
└─base::withCallingHandlers(...)
   #>  49. │                                   ├─purrr:::call_with_cleanup(...)
   #>  50. │                                   └─arrow (local) .f(.x[[i]], ...)
   #>  51. │                                     ├─base::paste0(...) at 
r/R/dplyr.R:129:6
   #>  52. │                                     └─expr$type(schm) at 
r/R/dplyr.R:129:6
   #>  53. │                                       
└─arrow:::compute___expr__type(self, schema) at r/R/expression.R:54:6
   #>  54. └─base::.handleSimpleError(...) at r/R/arrowExports.R:1152:2
   #>  55.   └─purrr (local) h(simpleError(msg, call))
   #>  56.     └─cli::cli_abort(...)
   #>  57.       └─rlang::abort(...)
   ```
   
   <sup>Created on 2024-01-03 with [reprex 
v2.0.2](https://reprex.tidyverse.org)</sup>
   
   You might be able to detect that column by doing something like:
   
   ``` r
   strange_object <- numeric()
   class(strange_object) <- NA_character_
   
   df <- data.frame(strange_object)
   vapply(lapply(df, class), function(x) any(is.na(x)), logical(1))
   #> strange_object 
   #>           TRUE
   ```
   
   <sup>Created on 2024-01-03 with [reprex 
v2.0.2](https://reprex.tidyverse.org)</sup>


-- 
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