[SPARK-47965][SQL][FOLLOW-UP] Uses `null` as its default value for `OptionalConfigEntry`
### What changes were proposed in this pull request?
This PR partially reverts https://github.com/apache/spark/pull/46197 because of the behaviour change below:
```python
>>> spark.conf.get("spark.sql.optimizer.excludedRules")
'<undefined>'
```
### Why are the changes needed?
To avoid behaviour change.
### Does this PR introduce _any_ user-facing change?
No, the main change has not been released out yet.
### How was this patch tested?
Manually as described above.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #46472 from HyukjinKwon/SPARK-47965-followup.
Authored-by: Hyukjin Kwon <gurwls223@apache.org>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
diff --git a/core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala b/core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala
index c07f252..a295ef0 100644
--- a/core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala
+++ b/core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala
@@ -227,7 +227,7 @@
prependSeparator,
alternatives,
s => Some(rawValueConverter(s)),
- v => v.map(rawStringConverter).getOrElse(ConfigEntry.UNDEFINED),
+ v => v.map(rawStringConverter).orNull,
doc,
isPublic,
version