Skip to content

Document DEFAULT keyword as a reserved term#11285

Closed
jhlodin wants to merge 1 commit intotrinodb:masterfrom
jhlodin:jl/default-keyword
Closed

Document DEFAULT keyword as a reserved term#11285
jhlodin wants to merge 1 commit intotrinodb:masterfrom
jhlodin:jl/default-keyword

Conversation

@jhlodin
Copy link
Copy Markdown
Contributor

@jhlodin jhlodin commented Mar 2, 2022

Description

DEFAULT is used as a keyword in Trino, at least in SET PARAMETERS clauses to revert a parameter back to its default value. It ought to be documented accordingly.

Is this change a fix, improvement, new feature, refactoring, or other?

Improvement

Is this a change to the core query engine, a connector, client library, or the SPI interfaces? (be specific)

Documentation

How would you describe this change to a non-technical end user or system administrator?

Documenting the DEFAULT SQL keyword in Trino

Related issues, pull requests, and links

Documentation

( ) No documentation is needed.
(x) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.

Release notes

(x) No release notes entries required.
( ) Release notes entries required with the following suggested text:

# Section
* Fix some things. ({issue}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label Mar 2, 2022
@jhlodin jhlodin requested review from hashhar and mosabua March 2, 2022 18:55
@jhlodin jhlodin added the docs label Mar 2, 2022
@jhlodin
Copy link
Copy Markdown
Contributor Author

jhlodin commented Mar 2, 2022

I considered adding a note about using DEFAULT in the CREATE TABLE and CREATE TABLE AS pages, to say that you can use it to set a default column value when defining a column. But:

  • I don't know if we actually support that in Trino
  • Maybe that's too much of a SQL fundamentals thing that it's overkill for us to document

Thoughts?

``CURRENT_TIMESTAMP`` reserved reserved
``CURRENT_USER`` reserved
``DEALLOCATE`` reserved reserved
``DEFAULT`` reserved reserved
Copy link
Copy Markdown
Member

@ebyhr ebyhr Mar 2, 2022

Choose a reason for hiding this comment

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

DEFAULT isn't a reserved keyword in Trino at this time. That is why docs-checks job is failing.
https://github.com/trinodb/trino/blob/master/core/trino-parser/src/main/antlr4/io/trino/sql/parser/SqlBase.g4#L707-L712

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Maybe I'm misunderstanding, I thought that DEFAULT being an accepted keyword in, at least, the ... SET PROPERTIES foo = DEFAULT context would mean that it's reserved?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We generally try not to make keywords reserved unless there's a potential ambiguity. I don't think that's the case with DEFAULT. Also, making it reserved would likely cause backwards-compatibility issues.

@findepi
Copy link
Copy Markdown
Member

findepi commented Mar 3, 2022

cc @martint @kasiafi

@jhlodin
Copy link
Copy Markdown
Contributor Author

jhlodin commented Mar 3, 2022

Closing as inaccurate

@jhlodin jhlodin closed this Mar 3, 2022
@jhlodin jhlodin deleted the jl/default-keyword branch March 3, 2022 18:16
@kasiafi
Copy link
Copy Markdown
Member

kasiafi commented Mar 3, 2022

I considered adding a note about using DEFAULT in the CREATE TABLE and CREATE TABLE AS pages, to say that you can use it to set a default column value when defining a column. But:
I don't know if we actually support that in Trino

We don't support it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Document support of DEFAULT keyword in properties

4 participants