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
sparklyr invocation chooses incorrect overloaded method #3360
Comments
Hi, is this using |
This was using sparklyr 1.8.2, although I suspect it affects other sparklyr versions including dev. I copied the sparklyr/java/spark-1.5.2/invoke.scala Lines 17 to 133 in 4d49e40
|
Ok thanks, is there some R code we can run to test that? I don't see an error that we can recreate |
Hi @joveyuan-db, are you sure you're on Spark 3.5? The latest GA release is 3.4.1. Also, with Databricks, Spark 3.4 (ML 13) and above does not currently work with CRAN |
Hi Edgar, yeah, I'm testing a preview build internally in Databricks. I'm using sparklyr from the Databricks cluster itself, so it doesn't require Databricks Connect though. The root cause (bug in |
sparklyr's invocation does not correctly handle overloaded methods with
Array
andMap
parameter types. Specifically, in the following examplefindMatchedSignature
chooses the first method and we invokef(args: Array[_])
withMap()
. Checking whether the array is non-empty then throws aMapError
. This issue is not exclusive to the fact that the map is empty.I believe this is the root cause of why parameterized queries break on Databricks (
sparklyr/R/dbi_spark_result.R
Lines 72 to 73 in 4d49e40
sql
method (https://github.com/apache/spark/blob/eb4152dfcd6e9ef42750e7bac5238efe641458d2/sql/core/src/main/scala/org/apache/spark/sql/SparkSession.scala#L641-L660). There now exists both asql(sqlText: String, args: Array[_])
and asql(sqlText: String, args: Map[String, Any])
method signature in newer Spark versions, leading to sparklyr choosing the wrong one.The text was updated successfully, but these errors were encountered: