You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "hevansDev (via GitHub)" <gi...@apache.org> on 2024/08/05 21:34:25 UTC
[PR] Added a topic listing reserved keywords (druid)
hevansDev opened a new pull request, #16843:
URL: https://github.com/apache/druid/pull/16843
<!-- Thanks for trying to help us make Apache Druid be the best it can be! Please fill out as much of the following information as is possible (where relevant, and remove it when irrelevant) to help make the intention and scope of this PR clear in order to ease review. -->
<!-- Please read the doc for contribution (https://github.com/apache/druid/blob/master/CONTRIBUTING.md) before making this PR. Also, once you open a PR, please _avoid using force pushes and rebasing_ since these make it difficult for reviewers to see what you've changed in response to their reviews. See [the 'If your pull request shows conflicts with master' section](https://github.com/apache/druid/blob/master/CONTRIBUTING.md#if-your-pull-request-shows-conflicts-with-master) for more details. -->
Fixes #16446
<!-- Replace XXXX with the id of the issue fixed in this PR. Remove this section if there is no corresponding issue. Don't reference the issue in the title of this pull-request. -->
<!-- If you are a committer, follow the PR action item checklist for committers:
https://github.com/apache/druid/blob/master/dev/committer-instructions.md#pr-and-issue-action-item-checklist-for-committers. -->
### Description
<!-- Describe the goal of this PR, what problem are you fixing. If there is a corresponding issue (referenced above), it's not necessary to repeat the description here, however, you may choose to keep one summary sentence. -->
<!-- Describe your patch: what did you change in code? How did you fix the problem? -->
<!-- If there are several relatively logically separate changes in this PR, create a mini-section for each of them. For example: -->
#### Added a topic documenting reserved keywords
* Added a list of keywords and reserved keywords unique to Apache Druid
* Linked to the reserved keywords and keywords inherited from Apache Calcite
<!--
In each section, please describe design decisions made, including:
- Choice of algorithms
- Behavioral aspects. What configuration values are acceptable? How are corner cases and error conditions handled, such as when there are insufficient resources?
- Class organization and design (how the logic is split between classes, inheritance, composition, design patterns)
- Method organization and design (how the logic is split between methods, parameters and return types)
- Naming (class, method, API, configuration, HTTP endpoint, names of emitted metrics)
-->
<!-- It's good to describe an alternative design (or mention an alternative name) for every design (or naming) decision point and compare the alternatives with the designs that you've implemented (or the names you've chosen) to highlight the advantages of the chosen designs and names. -->
<!-- If there was a discussion of the design of the feature implemented in this PR elsewhere (e. g. a "Proposal" issue, any other issue, or a thread in the development mailing list), link to that discussion from this PR description and explain what have changed in your final design compared to your original proposal or the consensus version in the end of the discussion. If something hasn't changed since the original discussion, you can omit a detailed discussion of those aspects of the design here, perhaps apart from brief mentioning for the sake of readability of this PR description. -->
<!-- Some of the aspects mentioned above may be omitted for simple and small changes. -->
#### Release note
Added a page to the documentation listing keywords and reserved keywords
<hr>
This PR has:
- [x] been self-reviewed.
- [x] added documentation for new or modified features or behaviors.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Added a topic listing reserved keywords (druid)
Posted by "techdocsmith (via GitHub)" <gi...@apache.org>.
techdocsmith commented on PR #16843:
URL: https://github.com/apache/druid/pull/16843#issuecomment-2270005849
Rather than create very short topic, wondering if it might fit near the end of the Druid SQL overview: `querying/sql.md`. @317brian or @vtlim , WDYT
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Added a topic listing reserved keywords (druid)
Posted by "hevansDev (via GitHub)" <gi...@apache.org>.
hevansDev commented on code in PR #16843:
URL: https://github.com/apache/druid/pull/16843#discussion_r1714276358
##########
docs/querying/sql.md:
##########
@@ -423,3 +423,17 @@ SELECT count(city) from druid.table where SCALAR_IN_ARRAY(city, ?)
```
sample java code using dynamic parameters is provided [here](../api-reference/sql-jdbc.md#dynamic-parameters).
+
+## Reserved keywords
+
+Druid SQL reserves certain keywords which are used in its query language. Apache Druid inherits all of the reserved keywords from [Apache Calcite](https://calcite.apache.org/docs/reference.html#keywords). In addition to these, the following reserved keywords are unique to Apache Druid: ```
+
+* **CLUSTERED**
+* **PARTITIONED**
+
+To use the reserved keywords in queries, enclose them in double quotation marks. For example, the reserved keyword **PARTITIONED** can be used in a query if and only if it is correctly quoted:
+
+```sql
+SELECT "CLUSTERED" from druid.table
Review Comment:
Will do, thanks Brian
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Added a topic listing reserved keywords (druid)
Posted by "317brian (via GitHub)" <gi...@apache.org>.
317brian commented on code in PR #16843:
URL: https://github.com/apache/druid/pull/16843#discussion_r1714187397
##########
docs/querying/sql.md:
##########
@@ -423,3 +423,17 @@ SELECT count(city) from druid.table where SCALAR_IN_ARRAY(city, ?)
```
sample java code using dynamic parameters is provided [here](../api-reference/sql-jdbc.md#dynamic-parameters).
+
+## Reserved keywords
+
+Druid SQL reserves certain keywords which are used in its query language. Apache Druid inherits all of the reserved keywords from [Apache Calcite](https://calcite.apache.org/docs/reference.html#keywords). In addition to these, the following reserved keywords are unique to Apache Druid: ```
+
+* **CLUSTERED**
+* **PARTITIONED**
+
+To use the reserved keywords in queries, enclose them in double quotation marks. For example, the reserved keyword **PARTITIONED** can be used in a query if and only if it is correctly quoted:
+
+```sql
+SELECT "CLUSTERED" from druid.table
Review Comment:
It's erroring on druid.table. I'm not sure why it's not erroring on other occurrences of it on the page, but adding it to the `website/.spelling` should resolve the issue
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Added a topic listing reserved keywords (druid)
Posted by "hevansDev (via GitHub)" <gi...@apache.org>.
hevansDev commented on code in PR #16843:
URL: https://github.com/apache/druid/pull/16843#discussion_r1716648503
##########
website/.spelling:
##########
@@ -324,6 +324,7 @@ deserializes
downtimes
druid
druid–kubernetes-extensions
+druid.table
Review Comment:
@317brian was having issues with it failing the spell check and suggested I had it here
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Added a topic listing reserved keywords (druid)
Posted by "vtlim (via GitHub)" <gi...@apache.org>.
vtlim commented on code in PR #16843:
URL: https://github.com/apache/druid/pull/16843#discussion_r1715658065
##########
docs/querying/sql.md:
##########
@@ -426,9 +426,14 @@ sample java code using dynamic parameters is provided [here](../api-reference/sq
## Reserved keywords
-There are reserved keywords in Apache Druid. To use reserved keywords in queries, enclose them in quote marks.
-
-Apache Druid inherits all of the reserved keywords from [Apache Calcite](https://calcite.apache.org/docs/reference.html#keywords). In addition to these the following keywords are unique to Apache Druid:
+Druid SQL reserves certain keywords which are used in its query language. Apache Druid inherits all of the reserved keywords from [Apache Calcite](https://calcite.apache.org/docs/reference.html#keywords). In addition to these, the following reserved keywords are unique to Apache Druid: ```
* **CLUSTERED**
* **PARTITIONED**
+
+To use the reserved keywords in queries, enclose them in double quotation marks. For example, the reserved keyword **PARTITIONED** can be used in a query if and only if it is correctly quoted:
+
+```sql
+SELECT "CLUSTERED" from druid.table
Review Comment:
```suggestion
SELECT "PARTITIONED" from druid.table
```
Matches the sentence above
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Added a topic listing reserved keywords (druid)
Posted by "vtlim (via GitHub)" <gi...@apache.org>.
vtlim commented on code in PR #16843:
URL: https://github.com/apache/druid/pull/16843#discussion_r1711796481
##########
docs/querying/sql.md:
##########
@@ -423,3 +423,12 @@ SELECT count(city) from druid.table where SCALAR_IN_ARRAY(city, ?)
```
sample java code using dynamic parameters is provided [here](../api-reference/sql-jdbc.md#dynamic-parameters).
+
+## Reserved keywords
+
+There are reserved keywords in Apache Druid. To use reserved keywords in queries, enclose them in quote marks.
Review Comment:
```suggestion
There are reserved keywords in Apache Druid. To use reserved keywords in queries, enclose them in quotation marks.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Added a topic listing reserved keywords (druid)
Posted by "vtlim (via GitHub)" <gi...@apache.org>.
vtlim commented on code in PR #16843:
URL: https://github.com/apache/druid/pull/16843#discussion_r1715658760
##########
website/.spelling:
##########
@@ -324,6 +324,7 @@ deserializes
downtimes
druid
druid–kubernetes-extensions
+druid.table
Review Comment:
Did it fail the spell check? If not, I don't think you'd need to add it since the spell check shouldn't run inside code blocks.
##########
docs/querying/sql.md:
##########
@@ -426,9 +426,14 @@ sample java code using dynamic parameters is provided [here](../api-reference/sq
## Reserved keywords
-There are reserved keywords in Apache Druid. To use reserved keywords in queries, enclose them in quote marks.
-
-Apache Druid inherits all of the reserved keywords from [Apache Calcite](https://calcite.apache.org/docs/reference.html#keywords). In addition to these the following keywords are unique to Apache Druid:
+Druid SQL reserves certain keywords which are used in its query language. Apache Druid inherits all of the reserved keywords from [Apache Calcite](https://calcite.apache.org/docs/reference.html#keywords). In addition to these, the following reserved keywords are unique to Apache Druid: ```
* **CLUSTERED**
* **PARTITIONED**
+
+To use the reserved keywords in queries, enclose them in double quotation marks. For example, the reserved keyword **PARTITIONED** can be used in a query if and only if it is correctly quoted:
+
+```sql
+SELECT "CLUSTERED" from druid.table
+
Review Comment:
```suggestion
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Added a topic listing reserved keywords (druid)
Posted by "vtlim (via GitHub)" <gi...@apache.org>.
vtlim commented on code in PR #16843:
URL: https://github.com/apache/druid/pull/16843#discussion_r1711797447
##########
docs/querying/sql.md:
##########
@@ -423,3 +423,12 @@ SELECT count(city) from druid.table where SCALAR_IN_ARRAY(city, ?)
```
sample java code using dynamic parameters is provided [here](../api-reference/sql-jdbc.md#dynamic-parameters).
+
+## Reserved keywords
+
+There are reserved keywords in Apache Druid. To use reserved keywords in queries, enclose them in quote marks.
+
+Apache Druid inherits all of the reserved keywords from [Apache Calcite](https://calcite.apache.org/docs/reference.html#keywords). In addition to these the following keywords are unique to Apache Druid:
+
+* **CLUSTERED**
+* **PARTITIONED**
Review Comment:
Could you add a short example of a query that uses the reserved keywords in quotation marks?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Added a topic listing reserved keywords (druid)
Posted by "317brian (via GitHub)" <gi...@apache.org>.
317brian merged PR #16843:
URL: https://github.com/apache/druid/pull/16843
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Added a topic listing reserved keywords (druid)
Posted by "vtlim (via GitHub)" <gi...@apache.org>.
vtlim commented on code in PR #16843:
URL: https://github.com/apache/druid/pull/16843#discussion_r1711795787
##########
docs/querying/sql.md:
##########
@@ -423,3 +423,12 @@ SELECT count(city) from druid.table where SCALAR_IN_ARRAY(city, ?)
```
sample java code using dynamic parameters is provided [here](../api-reference/sql-jdbc.md#dynamic-parameters).
+
+## Reserved keywords
+
+There are reserved keywords in Apache Druid. To use reserved keywords in queries, enclose them in quote marks.
Review Comment:
Maybe refer to "Druid SQL" instead of "Apache Druid" here. Can we turn this into an active sentence also? Druid SQL reserves certain keywords for...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Added a topic listing reserved keywords (druid)
Posted by "vtlim (via GitHub)" <gi...@apache.org>.
vtlim commented on code in PR #16843:
URL: https://github.com/apache/druid/pull/16843#discussion_r1715657102
##########
docs/querying/sql.md:
##########
@@ -426,9 +426,14 @@ sample java code using dynamic parameters is provided [here](../api-reference/sq
## Reserved keywords
-There are reserved keywords in Apache Druid. To use reserved keywords in queries, enclose them in quote marks.
-
-Apache Druid inherits all of the reserved keywords from [Apache Calcite](https://calcite.apache.org/docs/reference.html#keywords). In addition to these the following keywords are unique to Apache Druid:
+Druid SQL reserves certain keywords which are used in its query language. Apache Druid inherits all of the reserved keywords from [Apache Calcite](https://calcite.apache.org/docs/reference.html#keywords). In addition to these, the following reserved keywords are unique to Apache Druid: ```
Review Comment:
`````suggestion
Druid SQL reserves certain keywords which are used in its query language. Apache Druid inherits all of the reserved keywords from [Apache Calcite](https://calcite.apache.org/docs/reference.html#keywords). In addition to these, the following reserved keywords are unique to Apache Druid:
`````
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Added a topic listing reserved keywords (druid)
Posted by "writer-jill (via GitHub)" <gi...@apache.org>.
writer-jill commented on code in PR #16843:
URL: https://github.com/apache/druid/pull/16843#discussion_r1709105143
##########
docs/api-reference/reserved-keywords.md:
##########
@@ -0,0 +1,37 @@
+---
+id: sql-reserved-keywords
+title: SQL reserved keywords
+sidebar_label: Reserved keywords
+---
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+
+<!--
+
+ ~ 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.
+ -->
+
+This topic lists reserved keywords in Apache Druid which cannot be used unless in queries unless they are quoted.
Review Comment:
Passive to active.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Added a topic listing reserved keywords (druid)
Posted by "vtlim (via GitHub)" <gi...@apache.org>.
vtlim commented on code in PR #16843:
URL: https://github.com/apache/druid/pull/16843#discussion_r1715657102
##########
docs/querying/sql.md:
##########
@@ -426,9 +426,14 @@ sample java code using dynamic parameters is provided [here](../api-reference/sq
## Reserved keywords
-There are reserved keywords in Apache Druid. To use reserved keywords in queries, enclose them in quote marks.
-
-Apache Druid inherits all of the reserved keywords from [Apache Calcite](https://calcite.apache.org/docs/reference.html#keywords). In addition to these the following keywords are unique to Apache Druid:
+Druid SQL reserves certain keywords which are used in its query language. Apache Druid inherits all of the reserved keywords from [Apache Calcite](https://calcite.apache.org/docs/reference.html#keywords). In addition to these, the following reserved keywords are unique to Apache Druid: ```
Review Comment:
`````suggestion
Druid SQL reserves certain keywords which are used in its query language. Apache Druid inherits all of the reserved keywords from [Apache Calcite](https://calcite.apache.org/docs/reference.html#keywords). In addition to these, the following reserved keywords are unique to Apache Druid:
```
`````
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Added a topic listing reserved keywords (druid)
Posted by "hevansDev (via GitHub)" <gi...@apache.org>.
hevansDev commented on code in PR #16843:
URL: https://github.com/apache/druid/pull/16843#discussion_r1713892047
##########
docs/querying/sql.md:
##########
@@ -423,3 +423,12 @@ SELECT count(city) from druid.table where SCALAR_IN_ARRAY(city, ?)
```
sample java code using dynamic parameters is provided [here](../api-reference/sql-jdbc.md#dynamic-parameters).
+
+## Reserved keywords
+
+There are reserved keywords in Apache Druid. To use reserved keywords in queries, enclose them in quote marks.
Review Comment:
Had a go at rephrasing this line, please let me know what you think @vtlim. Thanks again for the feedback
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Added a topic listing reserved keywords (druid)
Posted by "LakshSingla (via GitHub)" <gi...@apache.org>.
LakshSingla commented on code in PR #16843:
URL: https://github.com/apache/druid/pull/16843#discussion_r1714046446
##########
docs/querying/sql.md:
##########
@@ -423,3 +423,17 @@ SELECT count(city) from druid.table where SCALAR_IN_ARRAY(city, ?)
```
sample java code using dynamic parameters is provided [here](../api-reference/sql-jdbc.md#dynamic-parameters).
+
+## Reserved keywords
+
+Druid SQL reserves certain keywords which are used in its query language. Apache Druid inherits all of the reserved keywords from [Apache Calcite](https://calcite.apache.org/docs/reference.html#keywords), in addition to these the following keywords unique to Apache Druid and are also reserved:
Review Comment:
```suggestion
Druid SQL reserves certain keywords which are used in its query language. Apache Druid inherits all of the reserved keywords from [Apache Calcite](https://calcite.apache.org/docs/reference.html#keywords). In addition to these, the following reserved keywords are unique to Apache Druid: ```
##########
docs/querying/sql.md:
##########
@@ -423,3 +423,17 @@ SELECT count(city) from druid.table where SCALAR_IN_ARRAY(city, ?)
```
sample java code using dynamic parameters is provided [here](../api-reference/sql-jdbc.md#dynamic-parameters).
+
+## Reserved keywords
+
+Druid SQL reserves certain keywords which are used in its query language. Apache Druid inherits all of the reserved keywords from [Apache Calcite](https://calcite.apache.org/docs/reference.html#keywords), in addition to these the following keywords unique to Apache Druid and are also reserved:
+
+* **CLUSTERED**
+* **PARTITIONED**
+
+To use reserved keywords in queries, enclose them in quotation marks, for example the reserved keyword **CYCLE** can be used in the following query only if correct quoted:
Review Comment:
```suggestion
To use the reserved keywords in queries, enclose them in double quotation marks. For example, the reserved keyword **PARTITIONED** can be used in a query if and only if it is correctly quoted:
```
##########
docs/querying/sql.md:
##########
@@ -423,3 +423,17 @@ SELECT count(city) from druid.table where SCALAR_IN_ARRAY(city, ?)
```
sample java code using dynamic parameters is provided [here](../api-reference/sql-jdbc.md#dynamic-parameters).
+
+## Reserved keywords
+
+Druid SQL reserves certain keywords which are used in its query language. Apache Druid inherits all of the reserved keywords from [Apache Calcite](https://calcite.apache.org/docs/reference.html#keywords), in addition to these the following keywords unique to Apache Druid and are also reserved:
+
+* **CLUSTERED**
+* **PARTITIONED**
+
+To use reserved keywords in queries, enclose them in quotation marks, for example the reserved keyword **CYCLE** can be used in the following query only if correct quoted:
Review Comment:
nit: It would be better to use either `CLUSTERED` or `PARTITIONED` in the example.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Added a topic listing reserved keywords (druid)
Posted by "writer-jill (via GitHub)" <gi...@apache.org>.
writer-jill commented on code in PR #16843:
URL: https://github.com/apache/druid/pull/16843#discussion_r1709099734
##########
docs/api-reference/reserved-keywords.md:
##########
@@ -0,0 +1,37 @@
+---
+id: sql-reserved-keywords
+title: SQL reserved keywords
+sidebar_label: Reserved keywords
+---
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+
+<!--
+
+ ~ 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.
+ -->
+
+This topic lists reserved keywords in Apache Druid which cannot be used unless in queries unless they are quoted.
Review Comment:
```suggestion
This topic lists reserved keywords in Apache Druid. To use reserved keywords in queries, enclose them in quote marks.
```
##########
docs/api-reference/reserved-keywords.md:
##########
@@ -0,0 +1,37 @@
+---
+id: sql-reserved-keywords
+title: SQL reserved keywords
+sidebar_label: Reserved keywords
+---
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+
+<!--
+
+ ~ 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.
+ -->
+
+This topic lists reserved keywords in Apache Druid which cannot be used unless in queries unless they are quoted.
+
+Apache Druid inherits all of the keywords and reserved keywords from [Apache Calcite](https://calcite.apache.org/docs/) which are [documented here](https://calcite.apache.org/docs/reference.html#keywords). In addition to these the following are keywords unique to Apache Druid, reserved keywords are in bold:
Review Comment:
```suggestion
Apache Druid inherits all keywords and reserved keywords from [Apache Calcite](https://calcite.apache.org/docs/reference.html#keywords). In addition to these the following keywords are unique to Apache Druid—reserved keywords are shown in bold:
```
##########
docs/api-reference/reserved-keywords.md:
##########
@@ -0,0 +1,37 @@
+---
+id: sql-reserved-keywords
+title: SQL reserved keywords
+sidebar_label: Reserved keywords
+---
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+
+<!--
+
+ ~ 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.
+ -->
+
+This topic lists reserved keywords in Apache Druid which cannot be used unless in queries unless they are quoted.
+
+Apache Druid inherits all of the keywords and reserved keywords from [Apache Calcite](https://calcite.apache.org/docs/) which are [documented here](https://calcite.apache.org/docs/reference.html#keywords). In addition to these the following are keywords unique to Apache Druid, reserved keywords are in bold:
Review Comment:
I don't think you need two links to Calcite.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Added a topic listing reserved keywords (druid)
Posted by "LakshSingla (via GitHub)" <gi...@apache.org>.
LakshSingla commented on code in PR #16843:
URL: https://github.com/apache/druid/pull/16843#discussion_r1705422029
##########
docs/api-reference/reserved-keywords.md:
##########
@@ -0,0 +1,37 @@
+---
+id: sql-reserved-keywords
+title: SQL reserved keywords
+sidebar_label: Reserved keywords
+---
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+
+<!--
+
+ ~ 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.
+ -->
+
+This topic lists reserved keywords in Apache Druid which cannot be used unless in queries unless they are quoted.
Review Comment:
`OVERWRITE` and `EXTERN` can be used unquoted. They are keywords, however not reserved keywords.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Added a topic listing reserved keywords (druid)
Posted by "vtlim (via GitHub)" <gi...@apache.org>.
vtlim commented on PR #16843:
URL: https://github.com/apache/druid/pull/16843#issuecomment-2276692301
@techdocsmith
> Rather than create very short topic, wondering if it might fit near the end of the Druid SQL overview: `querying/sql.md`. @317brian or @vtlim , WDYT
I agree. I think it would go well at the end of the SQL overview.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org