Failure to select column named "end", keyword is not ignored.
See original GitHub issueI came across dbeaver/plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/sql/SQLConstants.java after a user reporting failure to select data from a column that matches “end”. Can this keyword be avoided in this context? I understand that quoting or using backticks will work, but the aim here is to allow this to function so itellisense runs more smoothly. Is there a way to make exceptions / auto quote certain keywords?
Reproducible steps:
drop table if eixsts somedb.test_reserved_keywords;
show create table somedb.test_reserved_keywords;
Create basic table
create table if not exists somedb.test_reserved_keywords
(col1 string, col2 string, `end` string, `COUNT` int)
STORED AS ORC LOCATION '/group/somedb/hive/test_reserved_keywords';
Test
select * from somedb.test_reserved_keywords where COUNT = '';
[OK]
select * from somedb.test_reserved_keywords where end = '';
[FAIL]
# END is within the reserved keywords list.
select * from somedb.test_reserved_keywords where END = '';
[FAIL]
Error message:
Error while compiling statement: FAILED: ParseException line 1:54 cannot recognize input near 'end' '=' '''' in expression specification
Error while compiling statement: FAILED: ParseException line 1:54 cannot recognize input near 'end' '=' '''' in expression specification
org.apache.hadoop.hive.ql.parse.ParseException:line 1:54 cannot recognize input near 'end' '=' '''' in expression specification
org.apache.hadoop.hive.ql.parse.ParseException:line 1:54 cannot recognize input near 'end' '=' '''' in expression specification
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Can't select column name that is a SQL keyword
There are a variety of poorly named columns, such as "index", but doing something like a.index works fine. I've not run into this...
Read more >SQL error messages and exceptions - Oracle Help Center
A qualified column name ' <columnName> ' is not allowed in the ORDER BY clause. 42878, The ORDER BY clause of a SELECT...
Read more >Database engine events and errors - SQL Server
Consult this MSSQL error code list to find explanations for error messages for SQL Server database engine events.
Read more >9.3 Keywords and Reserved Words - MySQL :: Developer Zone
Certain keywords, such as SELECT , DELETE , or BIGINT , are reserved and require special treatment for use as identifiers such as...
Read more >Syntax and options of the UNLOAD control statement - IBM
If the table does not have any XML or LOB columns, SPANNED YES is ignored. ... the keywords and field-names that are used...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mtdeguzis You can enclose end in double quotes, like this:
Sure, thankfully the database connection settings migrate fine on OS X, and I can have multiple side by side by the nature of the DMG.
Version 6.2.3.201910201831
query
Still fails