Skip to content

Commit c6ca661

Browse files
sharangkgatorsmile
authored andcommitted
[SPARK-28814][SQL][DOC] Document SET/RESET in SQL Reference
### What changes were proposed in this pull request? Document SET/REST statement in SQL Reference Guide. ### Why are the changes needed? Currently Spark lacks documentation on the supported SQL constructs causing confusion among users who sometimes have to look at the code to understand the usage. This is aimed at addressing this issue. ### Does this PR introduce any user-facing change? Yes. #### Before: There was no documentation for this. #### After: **SET** ![image](https://user-images.githubusercontent.com/29914590/65037551-94a3c680-d96b-11e9-9d59-9f7af5185e06.png) ![image](https://user-images.githubusercontent.com/29914590/64858792-fb607180-d645-11e9-8a53-8cf87a166fc1.png) **RESET** ![image](https://user-images.githubusercontent.com/29914590/64859019-b12bc000-d646-11e9-8cb4-73dc21830067.png) ### How was this patch tested? Manual Review and Tested using jykyll build --serve Closes #25606 from sharangk/resetDoc. Authored-by: sharangk <sharan.gk@gmail.com> Signed-off-by: Xiao Li <gatorsmile@gmail.com>
1 parent 3fc52b5 commit c6ca661

File tree

2 files changed

+65
-2
lines changed

2 files changed

+65
-2
lines changed

docs/sql-ref-syntax-aux-conf-mgmt-reset.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,20 @@ license: |
1919
limitations under the License.
2020
---
2121

22-
**This page is under construction**
22+
### Description
23+
Reset all the properties specific to the current session to their default values. After RESET command, executing SET command will output empty.
24+
25+
### Syntax
26+
{% highlight sql %}
27+
RESET
28+
{% endhighlight %}
29+
30+
31+
### Examples
32+
{% highlight sql %}
33+
-- Reset all the properties specific to the current session to their default values.
34+
RESET;
35+
{% endhighlight %}
36+
37+
### Related Statements
38+
- [SET](sql-ref-syntax-aux-conf-mgmt-set.html)

docs/sql-ref-syntax-aux-conf-mgmt-set.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,51 @@ license: |
1919
limitations under the License.
2020
---
2121

22-
**This page is under construction**
22+
### Description
23+
The SET command sets a property, returns the value of an existing property or returns all SQLConf properties with value and meaning.
24+
25+
### Syntax
26+
{% highlight sql %}
27+
SET
28+
SET [ -v ]
29+
SET property_key[ = property_value ]
30+
{% endhighlight %}
31+
32+
### Parameters
33+
<dl>
34+
<dt><code><em>-v</em></code></dt>
35+
<dd>Outputs the key, value and meaning of existing SQLConf properties.</dd>
36+
</dl>
37+
38+
<dl>
39+
<dt><code><em>property_key</em></code></dt>
40+
<dd>Returns the value of specified property key.</dd>
41+
</dl>
42+
43+
<dl>
44+
<dt><code><em>property_key=property_value</em></code></dt>
45+
<dd>Sets the value for a given property key. If an old value exists for a given property key, then it gets overridden by the new value.</dd>
46+
</dl>
47+
48+
### Examples
49+
{% highlight sql %}
50+
-- Set a property.
51+
SET spark.sql.variable.substitute=false;
52+
53+
-- List all SQLConf properties with value and meaning.
54+
SET -v;
55+
56+
-- List all SQLConf properties with value for current session.
57+
SET;
58+
59+
-- List the value of specified property key.
60+
SET spark.sql.variable.substitute;
61+
+--------------------------------+--------+
62+
| key | value |
63+
+--------------------------------+--------+
64+
| spark.sql.variable.substitute | false |
65+
+--------------------------------+--------+
66+
{% endhighlight %}
67+
68+
### Related Statements
69+
- [RESET](sql-ref-syntax-aux-conf-mgmt-reset.html)

0 commit comments

Comments
 (0)