Skip to content

Conversation

@yaooqinn
Copy link
Member

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

@yaooqinn yaooqinn changed the title [SPARK-31498][SQL] Dump public static sql configurations through doc generation [SPARK-31498][SQL][DOCS] Dump public static sql configurations through doc generation Apr 20, 2020
@yaooqinn
Copy link
Member Author

cc @cloud-fan @dongjoon-hyun @maropu @HyukjinKwon thanks for review.

@SparkQA
Copy link

SparkQA commented Apr 20, 2020

Test build #121527 has finished for PR 28274 at commit 9324ba9.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Apr 20, 2020

Test build #121539 has finished for PR 28274 at commit 991a7ec.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Apr 21, 2020

Test build #121553 has finished for PR 28274 at commit 284ab70.

  • This patch passes all tests.
  • This patch does not merge cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Apr 21, 2020

Test build #121559 has finished for PR 28274 at commit b61b46c.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Apr 21, 2020

Test build #121562 has finished for PR 28274 at commit 4fca3fd.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@yaooqinn
Copy link
Member Author

retest this please


#### 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.
Copy link
Contributor

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 -> ()
Copy link
Contributor

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?

Copy link
Member Author

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?

Copy link
Contributor

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?

Copy link
Member Author

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.

@SparkQA
Copy link

SparkQA commented Apr 21, 2020

Test build #121572 has finished for PR 28274 at commit 4fca3fd.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Apr 21, 2020

Test build #121580 has finished for PR 28274 at commit 1de696e.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@yaooqinn
Copy link
Member Author

retest this please

@SparkQA
Copy link

SparkQA commented Apr 21, 2020

Test build #121582 has finished for PR 28274 at commit 81e043f.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Apr 21, 2020

Test build #121583 has finished for PR 28274 at commit 81e043f.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@cloud-fan
Copy link
Contributor

thanks, merging to master/3.0!

@cloud-fan cloud-fan closed this in 2c2062e Apr 22, 2020
cloud-fan pushed a commit that referenced this pull request Apr 22, 2020
…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>")
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it

@yaooqinn yaooqinn deleted the SPARK-31498 branch April 22, 2020 11:18

{% 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 %}
Copy link
Member

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.

Copy link
Member Author

@yaooqinn yaooqinn Apr 22, 2020

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?

Copy link
Member

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`.
Copy link
Member

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.

Copy link
Member Author

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

HyukjinKwon pushed a commit that referenced this pull request Apr 27, 2020
…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
![image](https://user-images.githubusercontent.com/8326978/80179099-5e7da200-8632-11ea-803f-d47a93151869.png)

Closes #28322 from yaooqinn/SPARK-31550.

Authored-by: Kent Yao <[email protected]>
Signed-off-by: HyukjinKwon <[email protected]>
HyukjinKwon pushed a commit that referenced this pull request Apr 27, 2020
…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
![image](https://user-images.githubusercontent.com/8326978/80179099-5e7da200-8632-11ea-803f-d47a93151869.png)

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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants