This is an automated email from the ASF dual-hosted git repository. yangjie01 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push: new 46f31844ebec [SPARK-52722][CORE] Deprecate JdbcRDD class 46f31844ebec is described below commit 46f31844ebec145f6812a41ca22ce966e276c8ce Author: Uros Stankovic <uros.stanko...@databricks.com> AuthorDate: Sat Jul 12 16:26:36 2025 +0800 [SPARK-52722][CORE] Deprecate JdbcRDD class `JdbcRDD` is legacy way to integrate Spark with JDBC sources. Instead of it, users should use newer and more powerful JDBC data source. ### What changes were proposed in this pull request? - Deprecating `JdbcRDD` ### Why are the changes needed? `JdbcRDD` is legacy feature not being used a lot anymore and it raises confusion because there are similar class called `JDBCRDD` that comes from the JDBC connector. ### Does this PR introduce _any_ user-facing change? `JdbcRDD` is deprecated now. [JDBC data source (connector)](https://spark.apache.org/docs/latest/sql-data-sources-jdbc.html) is more modern and more powerful way to connect to the JDBC source. ### How was this patch tested? No testing needed, adding Java annotation to the class. ### Was this patch authored or co-authored using generative AI tooling? No Closes #51415 from urosstan-db/SPARK-52722-Deprecate-legacy-JdbcRDD. Lead-authored-by: Uros Stankovic <uros.stanko...@databricks.com> Co-authored-by: Wenchen Fan <cloud0...@gmail.com> Signed-off-by: yangjie01 <yangji...@baidu.com> --- core/src/main/scala/org/apache/spark/rdd/JdbcRDD.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/main/scala/org/apache/spark/rdd/JdbcRDD.scala b/core/src/main/scala/org/apache/spark/rdd/JdbcRDD.scala index 8c10bcbc25a8..0edd3912afd6 100644 --- a/core/src/main/scala/org/apache/spark/rdd/JdbcRDD.scala +++ b/core/src/main/scala/org/apache/spark/rdd/JdbcRDD.scala @@ -54,7 +54,9 @@ private[spark] class JdbcPartition(idx: Int, val lower: Long, val upper: Long) e * @param mapRow a function from a ResultSet to a single row of the desired result type(s). * This should only call getInt, getString, etc; the RDD takes care of calling next. * The default maps a ResultSet to an array of Object. + * @deprecated Jdbc RDD is deprecated, consider using JDBC data source instead. */ +@deprecated("Jdbc RDD is deprecated, consider using JDBC data source instead.", "4.1.0") class JdbcRDD[T: ClassTag]( sc: SparkContext, getConnection: () => Connection, --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org