alamb commented on code in PR #27922:
URL: https://github.com/apache/datafusion/pull/27922#discussion_r4761147485


##########
datafusion/sqllogictest/test_files/keyword_identifiers.slt:
##########
@@ -0,0 +1,516 @@
+# 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.
+
+# Tests for SQL keywords used as unquoted table, column and alias names.
+#
+# Whether an unquoted keyword is accepted as an identifier is decided by
+# sqlparser, so these queries are sensitive to sqlparser upgrades.
+
+statement ok

Review Comment:
   New test for verifying the use of keywords as identifier



##########
datafusion/sqllogictest/test_files/functions.slt:
##########
@@ -1857,3 +1857,69 @@ Infinity
 
 statement ok
 drop table t1
+
+# Session information keywords such as `current_user`, with and without
+# an argument list
+
+query error DataFusion error: Schema error: No field named current_user\.
+SELECT current_user;
+
+query error DataFusion error: SQL error: ParserError\("Expected: end of 
statement, found: \( at Line: 1, Column: 20"\)
+SELECT current_user();

Review Comment:
   These functions may change behavior so let's document what is happening



##########
datafusion/sqllogictest/test_files/errors.slt:
##########
@@ -205,3 +205,20 @@ select * from (select 1 as x) t order by y;
 
 query error DataFusion error: Schema error: No field named t\.y\. Did you mean 
't\.x'\?\nValid fields are t\.x\.$
 select * from (select 1 as x) t order by t.y;
+
+# Unquoted `end` after a complete expression or relation is rejected

Review Comment:
   agent got confused about this syntax so let's keep it explcit



-- 
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: [email protected]

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