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

Docs: Add DDL docs for Views #9878

Merged
merged 1 commit into from
Mar 7, 2024
Merged

Conversation

nastra
Copy link
Contributor

@nastra nastra commented Mar 6, 2024

No description provided.

@nastra nastra requested a review from bitsondatadev March 6, 2024 11:08
@github-actions github-actions bot added the docs label Mar 6, 2024
@nastra nastra force-pushed the ddl-docs-for-views branch from 97c74ec to 923f18f Compare March 6, 2024 13:46
Copy link
Collaborator

@bitsondatadev bitsondatadev left a comment

Choose a reason for hiding this comment

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

Few fixes, but the info is great.

ALTER VIEW <viewName> SET TBLPROPERTIES ('key1' = 'val1', 'key2' = 'val2')
```

Properties can be removed using:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Properties can be removed using:
Remove properties of an existing view in a similar way using `ALTER VIEW ... UNSET`:

@nastra nastra force-pushed the ddl-docs-for-views branch 2 times, most recently from 1f42f7f to 7140502 Compare March 7, 2024 09:26
Copy link
Collaborator

@bitsondatadev bitsondatadev left a comment

Choose a reason for hiding this comment

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

Mostly nits. Address them at will. LGTM!


Create a simple view without any comments or properties:
```sql
CREATE VIEW <viewName> AS SELECT * from <tableName>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit

Suggested change
CREATE VIEW <viewName> AS SELECT * from <tableName>
CREATE VIEW <viewName> AS SELECT * FROM <tableName>


Using `IF NOT EXISTS` prevents the SQL statement from failing in case the view already exists:
```sql
CREATE VIEW IF NOT EXISTS <viewName> AS SELECT * from <tableName>
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit x2

Suggested change
CREATE VIEW IF NOT EXISTS <viewName> AS SELECT * from <tableName>
CREATE VIEW IF NOT EXISTS <viewName> AS SELECT * FROM <tableName>

@nastra nastra force-pushed the ddl-docs-for-views branch 2 times, most recently from 1502e6b to 86f3595 Compare March 7, 2024 13:02
@nastra nastra force-pushed the ddl-docs-for-views branch from 86f3595 to f36676b Compare March 7, 2024 13:03
@nastra
Copy link
Contributor Author

nastra commented Mar 7, 2024

thanks for reviewing @ajantha-bhat and @bitsondatadev

@nastra nastra merged commit d90ac00 into apache:main Mar 7, 2024
2 checks passed
@nastra nastra deleted the ddl-docs-for-views branch March 7, 2024 13:04
zachdisc pushed a commit to zachdisc/iceberg that referenced this pull request Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants