-
Notifications
You must be signed in to change notification settings - Fork 59
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
RCall Failing with rJava #408
Comments
Ok! I am back! This is obviously not an optimal solution but I discovered that this seems to work with Julia 1.0! 🎉 I was able to get everything working going back to that Julia version. However, I would like to get this working with Julia 1.6 - though I am on R 4.0.5, it still works with this old of a version. Thoughts as to what is going on? |
After further experimentation, I seem to have got this mostly working with Julia 1.6 and R 4.0.5! Here are the exact steps I took:
This worked for me and got around the java issues - mostly. When I run an R object string (i.e. R"....."), my R code successfully works. Strangely, in the R Julia REPL mode, it fails with a Java error again here:
Yet, that same line of R works perfectly in the native R REPL. However, for the most part I am quite content and happy. This gives me full interop with R as far as I can tell and I can use |
Just see this issue, and have some idea about it (but not sure if it is in the correct direction). From the code and the error message, it seems that that some package for SQL is involved, and the error message is that the some object class cannot be determined. I'm wondering whether this is caused by that the SQL package defines some S3 or S4 class in R, and also the difference between embedding R and interactive R (for example, some package related to S3 or S4 will be implicitly loaded by interactive R but not in embedding or non-interactive R, if I remember correctly, package |
By the way, one irrelevant question, is the R building from source and the julia official binary working with |
Hey @Non-Contradiction, Thanks for the response. I am quite naive about R so bear with me as I ask some follow up questions:
Thanks for helping me! Hopefully we can track down where this is coming from! |
|
Hey @Non-Contradiction - here are the results:
What should I do next? Was that helpful at all? |
Does |
Hey @Non-Contradiction - I tried running Also, here is some R code to try reproducing on your end: install.packages(c("SqlRender", "DatabaseConnector", "remotes"))
remotes::install_github("ohdsi/Eunomia", ref = "v1.0.0")
connectionDetails <- Eunomia::getEunomiaConnectionDetails()
library(DatabaseConnector)
connection <- connect(connectionDetails)
sql <- "SELECT *
FROM @cdm.condition_occurrence
LIMIT 1;"
result <- renderTranslateQuerySql(connection, sql, cdm = "main") Let me know if I can provide anything else. :) |
I try the code snippet and have some interesting observations:
So in sum, I somehow can reproduce all (?) the issues we have here using subtle combinations of An initial observation for these combinations is that all the methods inside a Julia REPL fail, including the segfault error (if we don't trigger Rjava initiation in advance) or Also, all the methods not inside a Julia REPL run without any problem including plain R and |
I am glad you were able to reproduce these strange errors. I am not sure if there is anything to be done as the work around of putting everything into the |
I'm going to go ahead and close this as stale, and I suspect that some of the shared library improvements in Julia 1.8+ might have addressed this anyway. 😄 Feel free to open up a new issue if there are still lingering problems! |
Hi JuliaInterop team,
Thanks for making a great package! That said, I am running into a rather odd issue that I am not sure how to surmount.
Error Description
I am trying to use a package within R called
DatabaseConnector
for SQL calls. Some other packages I am using also depend on this package. Whenever I try to use it, I get this error:When I try to examine or load
rJava
, I get this problem as well:Also, additionally, I have done this approach:
Which then hangs in the Julia REPL for a moment and then seg faults:
It is odd as I have definitely installed these packages within R itself. Furthermore, the R code I have written has zero problems with rJava and everything works perfectly.
I have used both the
R
version provided by dnf (4.0.4) and I have compiled and built from sourceR-0.4.0.5
with the--enable-R-shlib
. The error manifests across both installs. What is going on here?Version Information
Here is my Julia Version information:
and my R version information
Here is my OS information:
The text was updated successfully, but these errors were encountered: