nchammas commented on a change in pull request #27459: [SPARK-30510][SQL][DOCS]
Publicly document Spark SQL configuration options
URL: https://github.com/apache/spark/pull/27459#discussion_r375968787
##########
File path: sql/gen-sql-markdown.py
##########
@@ -218,9 +236,68 @@ def generate_sql_markdown(jvm, path):
mdfile.write("<br/>\n\n")
+def generate_sql_configs_table(jvm, path):
+ """
+ Generates an HTML table at `path` that lists all public SQL
+ configuration options.
+ """
+ sql_configs = _list_sql_configs(jvm)
+ value_reference_pattern = re.compile(r"^<value of (\S*)>$")
+
+ with open(path, 'w') as f:
+ f.write(dedent(
+ """
+ <table class="table">
+ <tr><th>Property Name</th><th>Default</th><th>Meaning</th></tr>
+ """
+ ))
+ for config in sorted(sql_configs, key=lambda x: x.name):
+ if config.default == "<undefined>":
+ default = "none"
+ elif config.default.startswith("<value of "):
+ referenced_config_name =
value_reference_pattern.match(config.default).group(1)
+ # difficultes in looking this up:
Review comment:
Agreed. I will remove this comment.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]