-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-31498][SQL][DOCS] Dump public static sql configurations through doc generation #28274
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
Conversation
|
cc @cloud-fan @dongjoon-hyun @maropu @HyukjinKwon thanks for review. |
sql/core/src/main/scala/org/apache/spark/sql/api/python/PythonSQLUtils.scala
Outdated
Show resolved
Hide resolved
|
Test build #121527 has finished for PR 28274 at commit
|
|
Test build #121539 has finished for PR 28274 at commit
|
|
Test build #121553 has finished for PR 28274 at commit
|
|
Test build #121559 has finished for PR 28274 at commit
|
|
Test build #121562 has finished for PR 28274 at commit
|
|
retest this please |
docs/configuration.md
Outdated
|
|
||
| #### Static SQL Configuration | ||
|
|
||
| Static SQL configurations are cross-session, immutable Spark SQL configurations. External users can query the static sql config values via `SparkSession.conf` or via set command, e.g. `SET spark.sql.extensions;`, but cannot set/unset them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should also mention how to set them, e.g. by config file or by setting SparkConf that is used to create SparkSession.
| def listStaticSQLConfigs(): Array[(String, String, String, String)] = { | ||
| val conf = new SQLConf() | ||
| // Force to build static SQL configurations | ||
| StaticSQLConf.WAREHOUSE_PATH.key -> () |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's special about WAREHOUSE_PATH?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing special, just find something to invoke? Couldn't find another proper way to build static ones to SQLConf, any advice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just write StaticSQLConf doesn't work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, it works. there must be some wrong with my environment when I try this way last time.
|
Test build #121572 has finished for PR 28274 at commit
|
|
Test build #121580 has finished for PR 28274 at commit
|
|
retest this please |
|
Test build #121582 has finished for PR 28274 at commit
|
|
Test build #121583 has finished for PR 28274 at commit
|
|
thanks, merging to master/3.0! |
…h doc generation ### What changes were proposed in this pull request? Currently, only the non-static public SQL configurations are dump to public doc, we'd better also add those static public ones as the command `set -v` This PR force call StaticSQLConf to buildStaticConf. ### Why are the changes needed? Fix missing SQL configurations in doc ### Does this PR introduce any user-facing change? NO ### How was this patch tested? add unit test and verify locally to see if public static SQL conf is in `docs/sql-config.html` Closes #28274 from yaooqinn/SPARK-31498. Authored-by: Kent Yao <[email protected]> Signed-off-by: Wenchen Fan <[email protected]> (cherry picked from commit 2c2062e) Signed-off-by: Wenchen Fan <[email protected]>
|
|
||
| if __name__ == "__main__": | ||
| if len(sys.argv) != 2: | ||
| print("Usage: ./bin/spark-submit sql/gen-sql-config-docs.py <static|runtime>") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could just call the function twice instead of adding an argument considering that SQL configuration gen is pretty cheap. Let's fix it next time when we happen to touch here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it
|
|
||
| {% for static_file in site.static_files %} | ||
| {% if static_file.name == 'generated-runtime-sql-config-table.html' %} | ||
| {% include_relative generated-runtime-sql-config-table.html %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I intentionally removed the leading spaces here because they are considered actual white spaces. Newer liquid syntax supports to ignore these white spaces but I didn't use in case old Jykill is used.
Seems like it could make the html format malformed in some cases given my rough testing. Let's remove these leading white spaces next time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might the problem be that ### Spark SQL content was inside the for-loop before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we already use the markdown and Liquid syntax together at https://github.com/apache/spark/blob/master/docs/sql-ref-functions-builtin.md
| #### Static SQL Configuration | ||
|
|
||
| Static SQL configurations are cross-session, immutable Spark SQL configurations. They can be set with final values by the config file | ||
| and command-line options with `--conf/-c` prefixed, or by setting `SparkConf` that are used to create `SparkSession`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could mention spark-default.conf too, but it's okay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by the config file might have the same meaning but it could be better if we use spark-default.conf
…eral meanings in sql configuration doc ### What changes were proposed in this pull request? ```scala spark.sql.session.timeZone spark.sql.warehouse.dir ``` these 2 configs are nondeterministic and vary with environments Besides, reflect code in `gen-sql-config-docs.py` via #28274 (comment) and `configuration.md` via #28274 (comment) ### Why are the changes needed? doc fix ### Does this PR introduce any user-facing change? no ### How was this patch tested? verify locally  Closes #28322 from yaooqinn/SPARK-31550. Authored-by: Kent Yao <[email protected]> Signed-off-by: HyukjinKwon <[email protected]>
…eral meanings in sql configuration doc ### What changes were proposed in this pull request? ```scala spark.sql.session.timeZone spark.sql.warehouse.dir ``` these 2 configs are nondeterministic and vary with environments Besides, reflect code in `gen-sql-config-docs.py` via #28274 (comment) and `configuration.md` via #28274 (comment) ### Why are the changes needed? doc fix ### Does this PR introduce any user-facing change? no ### How was this patch tested? verify locally  Closes #28322 from yaooqinn/SPARK-31550. Authored-by: Kent Yao <[email protected]> Signed-off-by: HyukjinKwon <[email protected]> (cherry picked from commit 5ba467c) Signed-off-by: HyukjinKwon <[email protected]>
What changes were proposed in this pull request?
Currently, only the non-static public SQL configurations are dump to public doc, we'd better also add those static public ones as the command
set -vThis PR force call StaticSQLConf to buildStaticConf.
Why are the changes needed?
Fix missing SQL configurations in doc
Does this PR introduce any user-facing change?
NO
How was this patch tested?
add unit test and verify locally to see if public static SQL conf is in
docs/sql-config.html