88fantasy opened a new issue, #4493: URL: https://github.com/apache/streampark/issues/4493
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/streampark/issues?q=is%3Aissue+label%3A%22bug%22) and found no similar issues referencing `SparkEnv.doSetSparkConf`. ### Java Version Temurin 21.0.11 (console), built with Microsoft OpenJDK 11.0.28 ### Scala Version 2.12.x ### StreamPark Version 3.0.0-SNAPSHOT (`dev` branch, commit `9ddda84c9`) ### Flink Version N/A (Spark) ### Deploy mode N/A (registration fails before any submission) ### What happened No unmodified Spark distribution can be registered as a Spark Home — `POST /spark/env/create` always fails: ``` java.sql.SQLException: Field 'spark_conf' doesn't have a default value ``` `SparkEnv.doSetSparkConf()` only assigns `this.sparkConf` when `conf/spark-defaults.conf` exists: ```java File yaml = new File(this.sparkHome.concat("/conf/spark-defaults.conf")); if (yaml.exists()) { String sparkConf = FileUtils.readFileToString(yaml, StandardCharsets.UTF_8); this.sparkConf = DeflaterUtils.zipString(sparkConf); } ``` An official Apache Spark distribution ships only `conf/spark-defaults.conf.template`, never `spark-defaults.conf` — so for a stock install the field is left `null`, and `t_spark_env.spark_conf` is `text NOT NULL` with no default. Confirmed by `touch`-ing an empty `conf/spark-defaults.conf` in the Spark home: registration then succeeds immediately, with the file's existence as the only changed variable. An absent file is the normal case for a stock distribution rather than an error, so it should be stored as an empty conf. ### Are you willing to submit PR? - [X] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
