Skip to content

Commit

Permalink
[SPARK-42861][SQL] Use private[sql] instead of protected[sql] to avoi…
Browse files Browse the repository at this point in the history
…d generating API doc

### What changes were proposed in this pull request?

This is the only issue I found during SQL module API auditing via apache/spark-website@6159860 . Somehow `protected[sql]` also generates API doc which is unexpected. `private[sql]` solves the problem and I generated doc locally to verify it.

Another API issue has been fixed by apache#40499

### Why are the changes needed?

fix api doc

### Does this PR introduce _any_ user-facing change?

no

### How was this patch tested?

N/A

Closes apache#40541 from cloud-fan/auditing.

Authored-by: Wenchen Fan <wenchen@databricks.com>
Signed-off-by: Kent Yao <yao@apache.org>
  • Loading branch information
cloud-fan authored and yaooqinn committed Mar 24, 2023
1 parent 18cd801 commit f7421b4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sql/core/src/main/scala/org/apache/spark/sql/RuntimeConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class RuntimeConfig private[sql](sqlConf: SQLConf = new SQLConf) {
/**
* Sets the given Spark runtime configuration property.
*/
protected[sql] def set[T](entry: ConfigEntry[T], value: T): Unit = {
private[sql] def set[T](entry: ConfigEntry[T], value: T): Unit = {
requireNonStaticConf(entry.key)
sqlConf.setConf(entry, value)
}
Expand Down Expand Up @@ -94,18 +94,18 @@ class RuntimeConfig private[sql](sqlConf: SQLConf = new SQLConf) {
* Returns the value of Spark runtime configuration property for the given key.
*/
@throws[NoSuchElementException]("if the key is not set")
protected[sql] def get[T](entry: ConfigEntry[T]): T = {
private[sql] def get[T](entry: ConfigEntry[T]): T = {
sqlConf.getConf(entry)
}

protected[sql] def get[T](entry: OptionalConfigEntry[T]): Option[T] = {
private[sql] def get[T](entry: OptionalConfigEntry[T]): Option[T] = {
sqlConf.getConf(entry)
}

/**
* Returns the value of Spark runtime configuration property for the given key.
*/
protected[sql] def get[T](entry: ConfigEntry[T], default: T): T = {
private[sql] def get[T](entry: ConfigEntry[T], default: T): T = {
sqlConf.getConf(entry, default)
}

Expand Down Expand Up @@ -153,7 +153,7 @@ class RuntimeConfig private[sql](sqlConf: SQLConf = new SQLConf) {
/**
* Returns whether a particular key is set.
*/
protected[sql] def contains(key: String): Boolean = {
private[sql] def contains(key: String): Boolean = {
sqlConf.contains(key)
}

Expand Down

0 comments on commit f7421b4

Please sign in to comment.