diff --git a/docs/_data/menu-sql.yaml b/docs/_data/menu-sql.yaml index 5d8c265bf84fe..26cca61a9d6ac 100644 --- a/docs/_data/menu-sql.yaml +++ b/docs/_data/menu-sql.yaml @@ -78,6 +78,8 @@ subitems: - text: Data Types url: sql-ref-datatypes.html + - text: Identifiers + url: sql-ref-identifier.html - text: Literals url: sql-ref-literals.html - text: Null Semantics diff --git a/docs/sql-ref-identifier.md b/docs/sql-ref-identifier.md new file mode 100644 index 0000000000000..89cde21e6fdb6 --- /dev/null +++ b/docs/sql-ref-identifier.md @@ -0,0 +1,80 @@ +--- +layout: global +title: Identifiers +displayTitle: Identifiers +license: | + 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. +--- + +### Description + +An identifier is a string used to identify a database object such as a table, view, schema, column, etc. Spark SQL has regular identifiers and delimited identifiers, which are enclosed within backticks. Both regular identifiers and delimited identifiers are case-insensitive. + +### Syntax + +#### Regular Identifier + +{% highlight sql %} +{ letter | digit | '_' } [ , ... ] +{% endhighlight %} +Note: If `spark.sql.ansi.enabled` is set to true, ANSI SQL reserved keywords cannot be used as identifiers. For more details, please refer to [ANSI Compliance](sql-ref-ansi-compliance.html). + +#### Delimited Identifier + +{% highlight sql %} +`c [ ... ]` +{% endhighlight %} + +### Parameters + +
letterdigitc` to escape special characters (e.g., `).
+