maropu commented on a change in pull request #28277:
URL: https://github.com/apache/spark/pull/28277#discussion_r412579671



##########
File path: docs/sql-ref-identifier.md
##########
@@ -0,0 +1,76 @@
+---
+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.

Review comment:
       > Both regular identifiers and delimited identifiers are case 
insensitive.
   
   This behaivour depneds on `spark.sql.caseSensitive`?

##########
File path: docs/sql-ref-identifier.md
##########
@@ -0,0 +1,76 @@
+---
+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.

Review comment:
       Are regular identifiers and delimited identifiers common words in 
database-like systems? Actually, the latter one is a table (or relation) 
identifier? Anyway, I think its better to use consistent words across SQL docs. 
For example, it seems the ANSI document just uses  `identifiers` like `...as 
identifiers for table, view, column, function, alias, etc.`
   
https://github.com/apache/spark/blob/master/docs/sql-ref-ansi-compliance.md#sql-keywords
   
   Also, I think we need some examples there like `regular identifiers (e.g., 
alias names, xxx, ...)`

##########
File path: docs/sql-ref-identifier.md
##########
@@ -0,0 +1,76 @@
+---
+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. If `spark.sql.ansi.enabled` is set to false 
(this is the default), strict-non-reserved keywords cannot be used as table 
aliases. Please refer to [ANSI Compliance](sql-ref-ansi-compliance.html) for a 
complete list of the keywords.
+
+#### Delimited Identifier
+
+{% highlight sql %}
+`c [ ... ]`
+{% endhighlight %}
+
+### Parameters
+
+<dl>
+  <dt><code><em>letter</em></code></dt>
+  <dd>
+    Any letter from A-Z or a-z.
+  </dd>
+</dl>
+<dl>
+  <dt><code><em>digit</em></code></dt>
+  <dd>
+    Any numeral from 0 to 9.
+  </dd>
+</dl>
+<dl>
+  <dt><code><em>c</em></code></dt>
+  <dd>
+    Any character from the character set. Use <code>`</code> to escape 
<code>`</code>.

Review comment:
       How about using the same words in 
https://github.com/apache/spark/pull/28237/files#diff-3b65d142b02e13e9889a0f558c0e7bc8R46
 ?

##########
File path: docs/sql-ref-identifier.md
##########
@@ -0,0 +1,76 @@
+---
+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. If `spark.sql.ansi.enabled` is set to false 
(this is the default), strict-non-reserved keywords cannot be used as table 
aliases. Please refer to [ANSI Compliance](sql-ref-ansi-compliance.html) for a 
complete list of the keywords.

Review comment:
       How about just saying it like "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) for a 
complete list of the keywords."? That's because we don't define what 
`strict-non-reserved` is in this page.

##########
File path: docs/sql-ref-identifier.md
##########
@@ -0,0 +1,76 @@
+---
+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. If `spark.sql.ansi.enabled` is set to false 
(this is the default), strict-non-reserved keywords cannot be used as table 
aliases. Please refer to [ANSI Compliance](sql-ref-ansi-compliance.html) for a 
complete list of the keywords.
+
+#### Delimited Identifier
+
+{% highlight sql %}
+`c [ ... ]`
+{% endhighlight %}
+
+### Parameters
+
+<dl>
+  <dt><code><em>letter</em></code></dt>
+  <dd>
+    Any letter from A-Z or a-z.
+  </dd>
+</dl>
+<dl>
+  <dt><code><em>digit</em></code></dt>
+  <dd>
+    Any numeral from 0 to 9.
+  </dd>
+</dl>
+<dl>
+  <dt><code><em>c</em></code></dt>
+  <dd>
+    Any character from the character set. Use <code>`</code> to escape 
<code>`</code>.
+  </dd>
+</dl>
+
+### Examples
+
+{% highlight sql %}
+-- This CREATE TABLE fails because of the illegal identifier name a.b
+CREATE TABLE test (a.b int);
+
+-- This CREATE TABLE works
+CREATE TABLE test (`a.b` int);

Review comment:
       We don't need to describe a multi-part name like `a.b.c` for DSv2? 
@cloud-fan 




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to