IMPALA-7705: [DOCS] Documented the ALTER DATABASE SET OWNER statement Change-Id: Ifac0b689d55f525145b37846967a7a22f0e9245b Reviewed-on: http://gerrit.cloudera.org:8080/11674 Tested-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com> Reviewed-by: Adam Holley <ahol...@cloudera.com> Reviewed-by: Fredy Wijaya <fwij...@cloudera.com>
Project: http://git-wip-us.apache.org/repos/asf/impala/repo Commit: http://git-wip-us.apache.org/repos/asf/impala/commit/1bfd7ee1 Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/1bfd7ee1 Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/1bfd7ee1 Branch: refs/heads/master Commit: 1bfd7ee1c6315cc38126ed81dd757f56e01c5b16 Parents: 9571b18 Author: Alex Rodoni <arod...@cloudera.com> Authored: Fri Oct 12 16:05:53 2018 -0700 Committer: Alex Rodoni <arod...@cloudera.com> Committed: Mon Oct 15 19:35:51 2018 +0000 ---------------------------------------------------------------------- docs/impala.ditamap | 1 + docs/topics/impala_adls.xml | 16 +++--- docs/topics/impala_alter_database.xml | 79 ++++++++++++++++++++++++++++++ docs/topics/impala_databases.xml | 9 ++-- 4 files changed, 93 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/impala/blob/1bfd7ee1/docs/impala.ditamap ---------------------------------------------------------------------- diff --git a/docs/impala.ditamap b/docs/impala.ditamap index 213d2c9..373b92d 100644 --- a/docs/impala.ditamap +++ b/docs/impala.ditamap @@ -129,6 +129,7 @@ under the License. <topicref href="topics/impala_langref_sql.xml"> <topicref href="topics/impala_ddl.xml"/> <topicref href="topics/impala_dml.xml"/> + <topicref href="topics/impala_alter_database.xml"/> <topicref href="topics/impala_alter_table.xml"/> <topicref href="topics/impala_alter_view.xml"/> <topicref href="topics/impala_comment.xml"/> http://git-wip-us.apache.org/repos/asf/impala/blob/1bfd7ee1/docs/topics/impala_adls.xml ---------------------------------------------------------------------- diff --git a/docs/topics/impala_adls.xml b/docs/topics/impala_adls.xml index a02525a..5d790c5 100644 --- a/docs/topics/impala_adls.xml +++ b/docs/topics/impala_adls.xml @@ -359,14 +359,14 @@ adl://<varname>your_account</varname>.azuredatalakestore.net/<varname>rest_of_di and tables are created. </p> - <p> - You can switch whether an existing table or partition points to data in HDFS or ADLS. For example, if you - have an Impala table or partition pointing to data files in HDFS or ADLS, and you later transfer those data - files to the other filesystem, use an <codeph>ALTER TABLE</codeph> statement to adjust the - <codeph>LOCATION</codeph> attribute of the corresponding table or partition to reflect that change. Because - Impala does not have an <codeph>ALTER DATABASE</codeph> statement, this location-switching technique is not - practical for entire databases that have a custom <codeph>LOCATION</codeph> attribute. - </p> + <p> You can switch whether an existing table or partition points to data + in HDFS or ADLS. For example, if you have an Impala table or partition + pointing to data files in HDFS or ADLS, and you later transfer those + data files to the other filesystem, use an <codeph>ALTER TABLE</codeph> + statement to adjust the <codeph>LOCATION</codeph> attribute of the + corresponding table or partition to reflect that change. This + location-switching technique is not practical for entire databases that + have a custom <codeph>LOCATION</codeph> attribute. </p> </conbody> http://git-wip-us.apache.org/repos/asf/impala/blob/1bfd7ee1/docs/topics/impala_alter_database.xml ---------------------------------------------------------------------- diff --git a/docs/topics/impala_alter_database.xml b/docs/topics/impala_alter_database.xml new file mode 100644 index 0000000..a768346 --- /dev/null +++ b/docs/topics/impala_alter_database.xml @@ -0,0 +1,79 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> +<!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> +<concept rev="3.1 IMPALA-7016" id="alter_database"> + + <title>ALTER DATABASE Statement</title> + + <titlealts audience="PDF"> + + <navtitle>ALTER DATABASE</navtitle> + + </titlealts> + + <prolog> + <metadata> + <data name="Category" value="Impala"/> + <data name="Category" value="SQL"/> + <data name="Category" value="DDL"/> + <data name="Category" value="Databases"/> + <data name="Category" value="Schemas"/> + <data name="Category" value="Developers"/> + <data name="Category" value="Data Analysts"/> + </metadata> + </prolog> + + <conbody> + + <p> + The <codeph>ALTER DATABASE</codeph> statement changes the characteristics of a database. + </p> + + <p> + Use the <codeph>SET OWNER</codeph> clause to transfer the ownership of the database from + the current owner to another user or a role. + </p> + + <p> + The database owner is originally set to the user who creates the database. An owner of a + database has the <codeph>ALL</codeph> privilege, but the term <codeph>OWNER</codeph> is + used to differentiate between the <codeph>ALL</codeph> privilege that is explicitly + granted via the <codeph>GRANT</codeph> statement and a privilege that is implicitly + granted by the <codeph>CREATE DATABASE</codeph> statement. + </p> + + <p conref="../shared/impala_common.xml#common/syntax_blurb"/> + +<codeblock> +ALTER DATABASE <varname>database_name</varname> SET OWNER USER user_name; +ALTER DATABASE <varname>database_name</varname> SET OWNER ROLE role_name; +</codeblock> + + <p conref="../shared/impala_common.xml#common/ddl_blurb"/> + + <p conref="../shared/impala_common.xml#common/cancel_blurb_no"/> + + <p> + <b>Added in:</b> <keyword keyref="impala31_full"/> + </p> + + </conbody> + +</concept> http://git-wip-us.apache.org/repos/asf/impala/blob/1bfd7ee1/docs/topics/impala_databases.xml ---------------------------------------------------------------------- diff --git a/docs/topics/impala_databases.xml b/docs/topics/impala_databases.xml index 3834cba..d1fd417 100644 --- a/docs/topics/impala_databases.xml +++ b/docs/topics/impala_databases.xml @@ -42,10 +42,11 @@ under the License. databases can contain tables with identical names. </p> - <p> - Creating a database is a lightweight operation. There are minimal database-specific properties to configure, - only <codeph>LOCATION</codeph> and <codeph>COMMENT</codeph>. There is no <codeph>ALTER DATABASE</codeph> statement. - </p> + <p> Creating a database is a lightweight operation. There are minimal + database-specific properties to configure, such as + <codeph>LOCATION</codeph> and <codeph>COMMENT</codeph>. </p> + <p>You can change the owner of a database with the <codeph>ALTER + DATABASE</codeph> statement. </p> <p> Typically, you create a separate database for each project or application, to avoid naming conflicts between