Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-28802][DOC][SQL]Document DESCRIBE DATABASE statement in SQL Reference #25528

Closed
wants to merge 7 commits into from

Conversation

kevinyu98
Copy link
Contributor

@kevinyu98 kevinyu98 commented Aug 21, 2019

What changes were proposed in this pull request?

Document DESCRIBE DATABASE statement in SQL Reference

Why are the changes needed?

To complete the SQL Reference

Does this PR introduce any user-facing change?

Yes

Before

There is no documentation for this command in sql reference

After

Screen Shot 2019-09-05 at 12 59 32 PM
Screen Shot 2019-09-05 at 12 59 45 PM

How was this patch tested?

Used jekyll build and serve to verify

@dilipbiswal
Copy link
Contributor

@kevinyu98 Can you please attach a screen-shot of the page ?

@@ -18,5 +18,23 @@ license: |
See the License for the specific language governing permissions and
limitations under the License.
---
### Description
Return the metadata of an existing database(name, comment and location). If the database does not exist,
Copy link
Member

Choose a reason for hiding this comment

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

Space after database

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok.

Return the metadata of an existing database(name, comment and location). If the database does not exist,
an exception is thrown.

When `extended` is specified, it also shows the database's properties.
Copy link
Member

Choose a reason for hiding this comment

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

EXTENDED for consistency

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure


### Example
{% highlight sql %}
DESCRIBE DATABASE EXTENDED tempdb
Copy link
Member

Choose a reason for hiding this comment

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

Can you provide any output? this doc page isn't giving much additional info (though there is not a lot to know, granted)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure

### Example
{% highlight sql %}
-- Create employees DATABASE
CREATE DATABASE EMPLOYEES COMMENT 'For software companies';
Copy link
Contributor

Choose a reason for hiding this comment

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

@kevinyu98 lets use lowercase for EMPLOYEES to match other PRS..

Copy link
Contributor Author

Choose a reason for hiding this comment

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


-- Describe employees DATABASE.
-- Returns Database Name, Description and Root location of the filesystem for the employees DATABASE
DESCRIBE DATABASE Employees;
Copy link
Contributor

Choose a reason for hiding this comment

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

@kevinyu98 ditto.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed

CREATE DATABASE EMPLOYEES COMMENT 'For software companies';

-- Describe employees DATABASE.
-- Returns Database Name, Description and Root location of the filesystem for the employees DATABASE
Copy link
Contributor

Choose a reason for hiding this comment

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

@kevinyu98 Can we please put DATABASE in another line with a comment marker. ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

-- Describe employees DATABASE.
-- Returns Database Name, Description and Root location of the filesystem for the employees DATABASE
DESCRIBE DATABASE Employees;
+-------------------------+-----------------------------+
Copy link
Contributor

Choose a reason for hiding this comment

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

@kevinyu98 Can we keep the results 2 spaces to the right to match other PRs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed


{% highlight sql %}
-- Create employees DATABASE
CREATE DATABASE EMPLOYEES COMMENT 'For software companies';
Copy link
Contributor

Choose a reason for hiding this comment

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

@kevinyu98 lowercase employees.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

-- Alter employees database to set DBPROPERTIES
ALTER DATABASE EMPLOYEES SET DBPROPERTIES ('Create-by' = 'Kevin', 'Create-date' = '09/01/2019');

-- Describe employees DATABASE with EXTENDED option to the database properties
Copy link
Contributor

Choose a reason for hiding this comment

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

@kevinyu98 "to return additional database properties"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok


{% highlight sql %}
-- Create deployment SCHEMA
CREATE SCHEMA DEPLOYMENT comment 'Deployment environment';
Copy link
Contributor

Choose a reason for hiding this comment

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

@kevinyu98 lowercase ..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

@dilipbiswal
Copy link
Contributor

LGTM
cc @gatorsmile

@gatorsmile
Copy link
Member

ok to test

@SparkQA
Copy link

SparkQA commented Sep 5, 2019

Test build #110203 has finished for PR 25528 at commit 59b4f1d.

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

@gatorsmile
Copy link
Member

LGTM

Thanks! Merged to master.

@gatorsmile gatorsmile closed this in 36f8e53 Sep 5, 2019
@kevinyu98
Copy link
Contributor Author

@gatorsmile thank a lot.

@dilipbiswal
Copy link
Contributor

retest this please

PavithraRamachandran pushed a commit to PavithraRamachandran/spark that referenced this pull request Sep 15, 2019
…eference

### What changes were proposed in this pull request?
Document DESCRIBE DATABASE statement in SQL Reference

### Why are the changes needed?

To complete the SQL Reference

### Does this PR introduce any user-facing change?
Yes

#### Before
There is no documentation for this command in sql reference

#### After
![Screen Shot 2019-09-05 at 12 59 32 PM](https://user-images.githubusercontent.com/7550280/64379235-53aec800-cfe3-11e9-8a51-ea55f0455c47.png)
![Screen Shot 2019-09-05 at 12 59 45 PM](https://user-images.githubusercontent.com/7550280/64379247-58737c00-cfe3-11e9-9a51-f12c5c5bc26a.png)

### How was this patch tested?
Used jekyll build and serve to verify

Closes apache#25528 from kevinyu98/sql-ref-describe.

Lead-authored-by: Kevin Yu <qyu@us.ibm.com>
Co-authored-by: Xiao Li <gatorsmile@gmail.com>
Signed-off-by: Xiao Li <gatorsmile@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants