Minus a reserved word?


#1

I have a column named minus. I’m guessing it is a reserved word, because whenever I reference it, my queries break. For example:
select sum(minus) from....
results in:

Exception: Parse failed: Encountered “( minus” at line 1, column 11. Was expecting one of: “NOT” …

Is there a way to escape or do I have to alter my column name?


#2

Hi

minus is a reserved word, please try your query as

select sum("minus") from ....

example

mapdql> create table badone (minus int);
mapdql> insert into badone values (23);
mapdql> insert into badone values (47);
mapdql> select max("minus") from badone;
EXPR$0                           
47                               

regards


#3

It would be preferable to sync the reserved words between the legacy and calcite parsers


#4

Hi,

We have also synced the reserved word list with latest calcite set.

This will stop the CREATE TABLE from being able to build a table with a column that is a reserved word.

regards