bq. Is this documented somewhere ? not as such, https://phoenix.apache.org/language/index.html#quoted_name is generally for case sensitive identifier(and to allow some special characters) and same can be used for keywords.
bq. Looks like tokens in phoenix-core/src/main/antlr3/PhoenixSQL.g would give us good idea. Yes Ted, you are right . Phoenix keywords are the tokens in phoenix-core/src/main/antlr3/PhoenixSQL.g On Sun, Aug 21, 2016 at 8:33 PM, Ted Yu <[email protected]> wrote: > Looks like tokens in phoenix-core/src/main/antlr3/PhoenixSQL.g would give > us good idea. > > Experts please correct me if I am wrong. > > On Sun, Aug 21, 2016 at 7:21 AM, Aaron Molitor <[email protected] > > wrote: > >> Thanks, Ankit, that worked. >> >> And on the heels of Ted's question... Are the reserved words documented >> (even if just a list) somewhere, I've been looking at this page: >> http://phoenix.apache.org/language/index.html -- it feels like where I >> should find a list like that, but I don't see it explicitly called out. >> >> -Aaron >> >> On Aug 21, 2016, at 09:04, Ted Yu <[email protected]> wrote: >> >> Ankit: >> Is this documented somewhere ? >> >> Thanks >> >> On Sun, Aug 21, 2016 at 6:07 AM, Ankit Singhal <[email protected]> >> wrote: >> >>> Aaron, >>> >>> you can escape check for reserved keyword with double quotes "" >>> >>> SELECT * FROM SYSTEM."FUNCTION" >>> >>> Regards, >>> Ankit Singhal >>> >>> On Fri, Aug 19, 2016 at 10:47 PM, Aaron Molitor < >>> [email protected]> wrote: >>> >>>> Looks like the SYSTEM.FUNCTION table is names with a reserved word. Is >>>> this a known bug? >>>> >>>> >>>> 0: jdbc:phoenix:stl-colo-srv073.splicemachine> !tables >>>> +------------+--------------+-------------+---------------+- >>>> ---------+------------+----------------------------+-------- >>>> ---------+--------------+-----------------+---------------+- >>>> --------------+-----------------+------------+-----------+ >>>> | TABLE_CAT | TABLE_SCHEM | TABLE_NAME | TABLE_TYPE | REMARKS | >>>> TYPE_NAME | SELF_REFERENCING_COL_NAME | REF_GENERATION | INDEX_STATE | >>>> IMMUTABLE_ROWS | SALT_BUCKETS | MULTI_TENANT | VIEW_STATEMENT | >>>> VIEW_TYPE | INDEX_TYP | >>>> +------------+--------------+-------------+---------------+- >>>> ---------+------------+----------------------------+-------- >>>> ---------+--------------+-----------------+---------------+- >>>> --------------+-----------------+------------+-----------+ >>>> | | SYSTEM | CATALOG | SYSTEM TABLE | | >>>> | | | | >>>> false | null | false | | >>>> | | >>>> | | SYSTEM | FUNCTION | SYSTEM TABLE | | >>>> | | | | >>>> false | null | false | | >>>> | | >>>> | | SYSTEM | SEQUENCE | SYSTEM TABLE | | >>>> | | | | >>>> false | null | false | | >>>> | | >>>> | | SYSTEM | STATS | SYSTEM TABLE | | >>>> | | | | >>>> false | null | false | | >>>> | | >>>> | | TPCH | CUSTOMER | TABLE | | >>>> | | | | >>>> false | null | false | | >>>> | | >>>> | | TPCH | LINEITEM | TABLE | | >>>> | | | | >>>> false | null | false | | >>>> | | >>>> | | TPCH | NATION | TABLE | | >>>> | | | | >>>> false | null | false | | >>>> | | >>>> | | TPCH | ORDERS | TABLE | | >>>> | | | | >>>> false | null | false | | >>>> | | >>>> | | TPCH | PART | TABLE | | >>>> | | | | >>>> false | null | false | | >>>> | | >>>> | | TPCH | PARTSUPP | TABLE | | >>>> | | | | >>>> false | null | false | | >>>> | | >>>> | | TPCH | REGION | TABLE | | >>>> | | | | >>>> false | null | false | | >>>> | | >>>> | | TPCH | SUPPLIER | TABLE | | >>>> | | | | >>>> false | null | false | | >>>> | | >>>> +------------+--------------+-------------+---------------+- >>>> ---------+------------+----------------------------+-------- >>>> ---------+--------------+-----------------+---------------+- >>>> --------------+-----------------+------------+-----------+ >>>> 0: jdbc:phoenix:stl-colo-srv073.splicemachine> select * from >>>> SYSTEM.FUNCTION; >>>> Error: ERROR 604 (42P00): Syntax error. Mismatched input. Expecting >>>> "NAME", got "FUNCTION" at line 1, column 22. (state=42P00,code=604) >>>> org.apache.phoenix.exception.PhoenixParserException: ERROR 604 >>>> (42P00): Syntax error. Mismatched input. Expecting "NAME", got "FUNCTION" >>>> at line 1, column 22. >>>> at org.apache.phoenix.exception.PhoenixParserException.newExcep >>>> tion(PhoenixParserException.java:33) >>>> at org.apache.phoenix.parse.SQLParser.parseStatement(SQLParser. >>>> java:111) >>>> at org.apache.phoenix.jdbc.PhoenixStatement$PhoenixStatementPar >>>> ser.parseStatement(PhoenixStatement.java:1280) >>>> at org.apache.phoenix.jdbc.PhoenixStatement.parseStatement(Phoe >>>> nixStatement.java:1363) >>>> at org.apache.phoenix.jdbc.PhoenixStatement.execute(PhoenixStat >>>> ement.java:1434) >>>> at sqlline.Commands.execute(Commands.java:822) >>>> at sqlline.Commands.sql(Commands.java:732) >>>> at sqlline.SqlLine.dispatch(SqlLine.java:807) >>>> at sqlline.SqlLine.begin(SqlLine.java:681) >>>> at sqlline.SqlLine.start(SqlLine.java:398) >>>> at sqlline.SqlLine.main(SqlLine.java:292) >>>> Caused by: MismatchedTokenException(65!=99) >>>> at org.apache.phoenix.parse.PhoenixSQLParser.recoverFromMismatc >>>> hedToken(PhoenixSQLParser.java:360) >>>> at org.apache.phoenix.shaded.org.antlr.runtime.BaseRecognizer.m >>>> atch(BaseRecognizer.java:115) >>>> at org.apache.phoenix.parse.PhoenixSQLParser.parseNoReserved(Ph >>>> oenixSQLParser.java:9969) >>>> at org.apache.phoenix.parse.PhoenixSQLParser.identifier(Phoenix >>>> SQLParser.java:9936) >>>> at org.apache.phoenix.parse.PhoenixSQLParser.from_table_name(Ph >>>> oenixSQLParser.java:9589) >>>> at org.apache.phoenix.parse.PhoenixSQLParser.table_factor(Phoen >>>> ixSQLParser.java:6244) >>>> at org.apache.phoenix.parse.PhoenixSQLParser.table_ref(PhoenixS >>>> QLParser.java:6066) >>>> at org.apache.phoenix.parse.PhoenixSQLParser.table_list(Phoenix >>>> SQLParser.java:6002) >>>> at org.apache.phoenix.parse.PhoenixSQLParser.parseFrom(PhoenixS >>>> QLParser.java:5967) >>>> at org.apache.phoenix.parse.PhoenixSQLParser.single_select(Phoe >>>> nixSQLParser.java:4595) >>>> at org.apache.phoenix.parse.PhoenixSQLParser.unioned_selects(Ph >>>> oenixSQLParser.java:4697) >>>> at org.apache.phoenix.parse.PhoenixSQLParser.select_node(Phoeni >>>> xSQLParser.java:4763) >>>> at org.apache.phoenix.parse.PhoenixSQLParser.oneStatement(Phoen >>>> ixSQLParser.java:789) >>>> at org.apache.phoenix.parse.PhoenixSQLParser.statement(PhoenixS >>>> QLParser.java:508) >>>> at org.apache.phoenix.parse.SQLParser.parseStatement(SQLParser. >>>> java:108) >>>> ... 9 more >>> >>> >>> >> >> >
