From b0e4c645e45207ecfddc759678a789bbe5017f35 Mon Sep 17 00:00:00 2001 From: Dilip Biswal Date: Tue, 20 Aug 2019 22:23:19 -0700 Subject: [PATCH 1/7] [SPARK-28789] Document ALTER DATABASE command --- docs/sql-ref-syntax-ddl-alter-database.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/sql-ref-syntax-ddl-alter-database.md b/docs/sql-ref-syntax-ddl-alter-database.md index 29e7ffb940107..b109861cacdae 100644 --- a/docs/sql-ref-syntax-ddl-alter-database.md +++ b/docs/sql-ref-syntax-ddl-alter-database.md @@ -18,5 +18,23 @@ license: | See the License for the specific language governing permissions and limitations under the License. --- +### Description +You can author metadata associated with a database by setting the `DBPROPERTIES`. Using this command +you can set key-value pairs in the `DBPROPERTIES`. The specified property values override any existing +value with the same property name. Please note that the usage of SCHEMA and DATABASE are interchangable +and mean the same thing. An error message is issued if the database does not exist in the system. This +command is mostly used to record the metadata for a database and can be used for auditing purposes. + +### Syntax +{% highlight sql %} +ALTER {DATABASE | SCHEMA} database_name SET DBPROPERTIES (propery_name=property_value, ...) +{% endhighlight %} + +### Example +{% highlight sql %} +ALTER DATABASE inventory SET DBPROPERTIES ('Edited-by' = 'John', 'Edit-date' = '01/01/2001') +{% endhighlight %} + +You can use [describe-database](sql-ref-syntax-aux-describe-database.html) command to verify the setting +of properties. -**This page is under construction** From 4b70e0c0baf4b6414e87be34f174fdda9c23649e Mon Sep 17 00:00:00 2001 From: Dilip Biswal Date: Wed, 21 Aug 2019 11:25:30 -0700 Subject: [PATCH 2/7] Code review --- docs/sql-ref-syntax-ddl-alter-database.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/sql-ref-syntax-ddl-alter-database.md b/docs/sql-ref-syntax-ddl-alter-database.md index b109861cacdae..5faecec179154 100644 --- a/docs/sql-ref-syntax-ddl-alter-database.md +++ b/docs/sql-ref-syntax-ddl-alter-database.md @@ -19,9 +19,9 @@ license: | limitations under the License. --- ### Description -You can author metadata associated with a database by setting the `DBPROPERTIES`. Using this command +You can author metadata associated with a database by setting `DBPROPERTIES`. Using this command you can set key-value pairs in the `DBPROPERTIES`. The specified property values override any existing -value with the same property name. Please note that the usage of SCHEMA and DATABASE are interchangable +value with the same property name. Please note that the usage of `SCHEMA` and `DATABASE` are interchangable and mean the same thing. An error message is issued if the database does not exist in the system. This command is mostly used to record the metadata for a database and can be used for auditing purposes. From 42a7e4e79381ccdffd530c7320d895f4c9f3716f Mon Sep 17 00:00:00 2001 From: Dilip Biswal Date: Wed, 28 Aug 2019 11:46:25 -0700 Subject: [PATCH 3/7] css changes for parameters --- docs/css/main.css | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/css/main.css b/docs/css/main.css index fdfe4bda852a0..c0e49e5b87b00 100755 --- a/docs/css/main.css +++ b/docs/css/main.css @@ -81,6 +81,18 @@ code { color: #444444; } +dt code { + white-space: nowrap; + max-width: 100%; + border: solid 1px #e1e4e5; + font-size: .8rem; + padding: 0 5px; + font-family: Consolas,"Andale Mono WT","Andale Mono","Lucida Console","Lucida Sans Typewriter","DejaVu Sans Mono","Bitstream Vera Sans Mono","Liberation Mono","Nimbus Mono L",Monaco,"Courier New",Courier,monospace; + overflow-x: auto; + } + +dd { margin: 0 1.5em 1.5em; } + div .highlight pre { font-size: 12px; } From 3eb967c7aa076896a3f6e6dc5dcafb372831d4bf Mon Sep 17 00:00:00 2001 From: Dilip Biswal Date: Wed, 28 Aug 2019 11:46:43 -0700 Subject: [PATCH 4/7] changes --- docs/sql-ref-syntax-ddl-alter-database.md | 45 +++++++++++++++++------ 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/docs/sql-ref-syntax-ddl-alter-database.md b/docs/sql-ref-syntax-ddl-alter-database.md index 5faecec179154..10e5ccd6da5e7 100644 --- a/docs/sql-ref-syntax-ddl-alter-database.md +++ b/docs/sql-ref-syntax-ddl-alter-database.md @@ -19,22 +19,45 @@ license: | limitations under the License. --- ### Description -You can author metadata associated with a database by setting `DBPROPERTIES`. Using this command -you can set key-value pairs in the `DBPROPERTIES`. The specified property values override any existing -value with the same property name. Please note that the usage of `SCHEMA` and `DATABASE` are interchangable -and mean the same thing. An error message is issued if the database does not exist in the system. This -command is mostly used to record the metadata for a database and can be used for auditing purposes. +You can author metadata associated with a database by setting `DBPROPERTIES`. The specified property +values override any existing value with the same property name. Please note that the usage of +`SCHEMA` and `DATABASE` are interchangable and one can be used in place of the other. An error message +is issued if the database is not found in the system. This command is mostly used to record the metadata +for a database and may be used for auditing purposes. ### Syntax {% highlight sql %} -ALTER {DATABASE | SCHEMA} database_name SET DBPROPERTIES (propery_name=property_value, ...) +ALTER {DATABASE | SCHEMA} database_name SET DBPROPERTIES (propery_name=property_value, ...); {% endhighlight %} -### Example +### Parameters +
+
database_name
+
+ Specifies the name of the database to be altered. +
+
+ +### Examples {% highlight sql %} -ALTER DATABASE inventory SET DBPROPERTIES ('Edited-by' = 'John', 'Edit-date' = '01/01/2001') -{% endhighlight %} +-- Creates a database named `inventory`. +CREATE DATABASE inventory; + +-- Alters the database to set properties `Edited-by` and `Edit-date`. +ALTER DATABASE inventory SET DBPROPERTIES ('Edited-by' = 'John', 'Edit-date' = '01/01/2001'); -You can use [describe-database](sql-ref-syntax-aux-describe-database.html) command to verify the setting -of properties. +-- Verify that properties are set. +DESCRIBE DATABASE EXTENDED inventory; + + +-------------------------+--------------------------------------------+ + |database_description_item|database_description_value | + +-------------------------+--------------------------------------------+ + |Database Name |inventory | + |Description | | + |Location |file:/temp/spark-warehouse/inventory.db | + |Properties |((Edit-date,01/01/2001), (Edited-by,John)) | + +-------------------------+--------------------------------------------+ +{% endhighlight %} +### Related Statements +- [DESCRIBE DATABASE](sql-ref-syntax-aux-describe-database.html) From 0d130f6bf36f3a23c56472f5ea666f7fb2613140 Mon Sep 17 00:00:00 2001 From: Dilip Biswal Date: Wed, 28 Aug 2019 14:04:13 -0700 Subject: [PATCH 5/7] nit --- docs/css/main.css | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/docs/css/main.css b/docs/css/main.css index c0e49e5b87b00..e24dff8531f24 100755 --- a/docs/css/main.css +++ b/docs/css/main.css @@ -82,16 +82,18 @@ code { } dt code { - white-space: nowrap; - max-width: 100%; - border: solid 1px #e1e4e5; - font-size: .8rem; - padding: 0 5px; - font-family: Consolas,"Andale Mono WT","Andale Mono","Lucida Console","Lucida Sans Typewriter","DejaVu Sans Mono","Bitstream Vera Sans Mono","Liberation Mono","Nimbus Mono L",Monaco,"Courier New",Courier,monospace; - overflow-x: auto; - } - -dd { margin: 0 1.5em 1.5em; } + white-space: nowrap; + max-width: 100%; + border: solid 1px #e1e4e5; + font-size: .8rem; + padding: 0 5px; + font-family: "Menlo", "Lucida Console", monospace; + overflow-x: auto; +} + +dd { + margin: 0 1.5em 1.5em; +} div .highlight pre { font-size: 12px; From ffa449f3aaff4fcdcf3b916b0987a632202939c9 Mon Sep 17 00:00:00 2001 From: Dilip Biswal Date: Wed, 28 Aug 2019 14:06:32 -0700 Subject: [PATCH 6/7] minor --- docs/sql-ref-syntax-ddl-alter-database.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/sql-ref-syntax-ddl-alter-database.md b/docs/sql-ref-syntax-ddl-alter-database.md index 10e5ccd6da5e7..f025121ae3903 100644 --- a/docs/sql-ref-syntax-ddl-alter-database.md +++ b/docs/sql-ref-syntax-ddl-alter-database.md @@ -33,9 +33,7 @@ ALTER {DATABASE | SCHEMA} database_name SET DBPROPERTIES (propery_name=property_ ### Parameters
database_name
-
- Specifies the name of the database to be altered. -
+
Specifies the name of the database to be altered.
### Examples From 843f70595d2fbd7e21e7817e3f92f1310fd8b863 Mon Sep 17 00:00:00 2001 From: Xiao Li Date: Wed, 28 Aug 2019 15:29:08 -0700 Subject: [PATCH 7/7] Update sql-ref-syntax-ddl-alter-database.md --- docs/sql-ref-syntax-ddl-alter-database.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sql-ref-syntax-ddl-alter-database.md b/docs/sql-ref-syntax-ddl-alter-database.md index f025121ae3903..6e985862b8421 100644 --- a/docs/sql-ref-syntax-ddl-alter-database.md +++ b/docs/sql-ref-syntax-ddl-alter-database.md @@ -19,7 +19,7 @@ license: | limitations under the License. --- ### Description -You can author metadata associated with a database by setting `DBPROPERTIES`. The specified property +You can alter metadata associated with a database by setting `DBPROPERTIES`. The specified property values override any existing value with the same property name. Please note that the usage of `SCHEMA` and `DATABASE` are interchangable and one can be used in place of the other. An error message is issued if the database is not found in the system. This command is mostly used to record the metadata