[jira] [Commented] (TRAFODION-3131) Use of reserved words as names fails in many places
[ https://issues.apache.org/jira/browse/TRAFODION-3131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16540601#comment-16540601 ] ASF GitHub Bot commented on TRAFODION-3131: --- Github user asfgit closed the pull request at: https://github.com/apache/trafodion/pull/1637 > Use of reserved words as names fails in many places > --- > > Key: TRAFODION-3131 > URL: https://issues.apache.org/jira/browse/TRAFODION-3131 > Project: Apache Trafodion > Issue Type: Bug > Components: sql-cmp >Affects Versions: 2.3 >Reporter: David Wayne Birdsall >Assignee: David Wayne Birdsall >Priority: Major > Attachments: jira.sql.txt > > > It should be possible to use a reserved word (e.g., "YEAR") as an identifier > if it is made into a delimited identifier (that is, upper-cased and > surrounded with double-quotes). The sqlci session below demonstrates several > examples where this fails: > {quote}>>obey jira.sql; > >>-- script to reproduce various problems with reserved words > >> > >>?section tablename > >> > >>-- reserved word as a table name fails in various places > >> > >>create table "DELETE" (c1 int); > --- SQL operation complete. > >>invoke "DELETE"; > *** ERROR[15001] A syntax error occurred at or before: > TABLE TRAFODION.SCH.DELETE; > ^ (26 characters from start of SQL statement) > *** ERROR[15001] A syntax error occurred at or before: > TABLE ; > ^ (7 characters from start of SQL statement) > *** ERROR[8822] The statement was not prepared. > >>showddl "DELETE"; > CREATE TABLE TRAFODION.SCH.DELETE > ( > C1 INT DEFAULT NULL NOT SERIALIZED > ) > ATTRIBUTES ALIGNED FORMAT > ; > -- GRANT SELECT, INSERT, DELETE, UPDATE, REFERENCES ON TRAFODION.SCH.DELETE > TO DB__ROOT WITH GRANT OPTION; > --- SQL operation complete. > >>insert into "DELETE" values (1); > *** ERROR[8448] Unable to access Hbase interface. Call to > ExpHbaseInterface::checkAndInsertRow returned error HBASE_ACCESS_ERROR(-706). > Cause: java.lang.IllegalArgumentException: Table qualifier must not be empty > org.apache.hadoop.hbase.TableName.isLegalTableQualifierName(TableName.java:179) > org.apache.hadoop.hbase.TableName.isLegalTableQualifierName(TableName.java:149) > org.apache.hadoop.hbase.TableName.(TableName.java:322) > org.apache.hadoop.hbase.TableName.createTableNameIfNecessary(TableName.java:358) > org.apache.hadoop.hbase.TableName.valueOf(TableName.java:418) > org.apache.hadoop.hbase.client.HTable.(HTable.java:274) > org.apache.hadoop.hbase.client.transactional.TransactionalTable.(TransactionalTable.java:138) > org.apache.hadoop.hbase.client.transactional.RMInterface.(RMInterface.java:159) > org.trafodion.sql.HTableClient.init(HTableClient.java:348) > org.trafodion.sql.HBaseClient.getHTableClient(HBaseClient.java:1008) > org.trafodion.sql.HBaseClient.insertRow(HBaseClient.java:1964). > --- 0 row(s) inserted. > >>delete from "DELETE" where c1=1; > *** ERROR[8448] Unable to access Hbase interface. Call to > ExpHbaseInterface::scanOpen returned error HBASE_OPEN_ERROR(-704). Cause: > java.lang.IllegalArgumentException: Table qualifier must not be empty > org.apache.hadoop.hbase.TableName.isLegalTableQualifierName(TableName.java:179) > org.apache.hadoop.hbase.TableName.isLegalTableQualifierName(TableName.java:149) > org.apache.hadoop.hbase.TableName.(TableName.java:322) > org.apache.hadoop.hbase.TableName.createTableNameIfNecessary(TableName.java:358) > org.apache.hadoop.hbase.TableName.valueOf(TableName.java:418) > org.apache.hadoop.hbase.client.HTable.(HTable.java:274) > org.apache.hadoop.hbase.client.transactional.TransactionalTable.(TransactionalTable.java:138) > org.apache.hadoop.hbase.client.transactional.RMInterface.(RMInterface.java:159) > org.trafodion.sql.HTableClient.init(HTableClient.java:348) > org.trafodion.sql.HBaseClient.getHTableClient(HBaseClient.java:1008). > --- 0 row(s) deleted. > >>update "DELETE" set c1=2 where c1=1; > *** ERROR[8448] Unable to access Hbase interface. Call to > ExpHbaseInterface::scanOpen returned error HBASE_OPEN_ERROR(-704). Cause: > java.lang.IllegalArgumentException: Table qualifier must not be empty > org.apache.hadoop.hbase.TableName.isLegalTableQualifierName(TableName.java:179) > org.apache.hadoop.hbase.TableName.isLegalTableQualifierName(TableName.java:149) > org.apache.hadoop.hbase.TableName.(TableName.java:322) > org.apache.hadoop.hbase.TableName.createTableNameIfNecessary(TableName.java:358) > org.apache.hadoop.hbase.TableName.valueOf(TableName.java:418) > org.apache.hadoop.hbase.client.HTable.(HTable.java:274) > org.apache.hadoop.hbase.client.transactional.TransactionalTable.(TransactionalTable.java:138) > org.apache.hadoop.hbase.client.transactional.RMInterface.(RMInterface.java:159) > org.trafodion.sql.HTableClient.init(HTableClient.java:348) >
[jira] [Commented] (TRAFODION-3131) Use of reserved words as names fails in many places
[ https://issues.apache.org/jira/browse/TRAFODION-3131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16539272#comment-16539272 ] ASF GitHub Bot commented on TRAFODION-3131: --- GitHub user DaveBirdsall opened a pull request: https://github.com/apache/trafodion/pull/1637 [TRAFODION-3131] Fix some reserved and non-reserved word issues This set of changes does the following: 1. Fixes some issues with reserved words not being recognized as reserved words. 2. Updates core/TEST037 to include test cases for some recently added functions (CRC32, MD5, SHA, SHA1 and SHA2) 3. Updates the expected results for core/TEST037. Note: I'm aware that the comments in core/TEST037 are not perfectly aligned with the expected results. (But they are much more aligned than they were.) Will leave further improvements to follow-up work. Note: I considered refactoring common/ComResWords.cpp and the "prettify SQL text" functions in common/NAString.cpp, moving them to the parser and changing them to use the ParKeyWords table in parser/ParKeyWords.cpp. I wanted to do this to simplify development, consolidating three keyword tables into one. I started down this path and discovered that this was far from easy; moreover I concluded that it wouldn't actually simplify development much. So I fell back to the position of merely adding thorough documentation to parser/ParKeyWords.cpp, giving instructions on how to keep these tables in sync. You can merge this pull request into a Git repository by running: $ git pull https://github.com/DaveBirdsall/trafodion Trafodion3131 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/trafodion/pull/1637.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1637 commit 8ed5ca2070d28e6a331ded03ea1a02af5e15c932 Author: Dave Birdsall Date: 2018-07-10T21:51:28Z [TRAFODION-3131] Fix some reserved and non-reserved word issues > Use of reserved words as names fails in many places > --- > > Key: TRAFODION-3131 > URL: https://issues.apache.org/jira/browse/TRAFODION-3131 > Project: Apache Trafodion > Issue Type: Bug > Components: sql-cmp >Affects Versions: 2.3 >Reporter: David Wayne Birdsall >Assignee: David Wayne Birdsall >Priority: Major > Attachments: jira.sql.txt > > > It should be possible to use a reserved word (e.g., "YEAR") as an identifier > if it is made into a delimited identifier (that is, upper-cased and > surrounded with double-quotes). The sqlci session below demonstrates several > examples where this fails: > {quote}>>obey jira.sql; > >>-- script to reproduce various problems with reserved words > >> > >>?section tablename > >> > >>-- reserved word as a table name fails in various places > >> > >>create table "DELETE" (c1 int); > --- SQL operation complete. > >>invoke "DELETE"; > *** ERROR[15001] A syntax error occurred at or before: > TABLE TRAFODION.SCH.DELETE; > ^ (26 characters from start of SQL statement) > *** ERROR[15001] A syntax error occurred at or before: > TABLE ; > ^ (7 characters from start of SQL statement) > *** ERROR[8822] The statement was not prepared. > >>showddl "DELETE"; > CREATE TABLE TRAFODION.SCH.DELETE > ( > C1 INT DEFAULT NULL NOT SERIALIZED > ) > ATTRIBUTES ALIGNED FORMAT > ; > -- GRANT SELECT, INSERT, DELETE, UPDATE, REFERENCES ON TRAFODION.SCH.DELETE > TO DB__ROOT WITH GRANT OPTION; > --- SQL operation complete. > >>insert into "DELETE" values (1); > *** ERROR[8448] Unable to access Hbase interface. Call to > ExpHbaseInterface::checkAndInsertRow returned error HBASE_ACCESS_ERROR(-706). > Cause: java.lang.IllegalArgumentException: Table qualifier must not be empty > org.apache.hadoop.hbase.TableName.isLegalTableQualifierName(TableName.java:179) > org.apache.hadoop.hbase.TableName.isLegalTableQualifierName(TableName.java:149) > org.apache.hadoop.hbase.TableName.(TableName.java:322) > org.apache.hadoop.hbase.TableName.createTableNameIfNecessary(TableName.java:358) > org.apache.hadoop.hbase.TableName.valueOf(TableName.java:418) > org.apache.hadoop.hbase.client.HTable.(HTable.java:274) > org.apache.hadoop.hbase.client.transactional.TransactionalTable.(TransactionalTable.java:138) > org.apache.hadoop.hbase.client.transactional.RMInterface.(RMInterface.java:159) > org.trafodion.sql.HTableClient.init(HTableClient.java:348) > org.trafodion.sql.HBaseClient.getHTableClient(HBaseClient.java:1008) > org.trafodion.sql.HBaseClient.insertRow(HBaseClient.java:1964). > --- 0 row(s) inserted. > >>delete from "DELETE" where c1=1; > *** ERROR[8448] Unable to access Hbase interface. Call to >
[jira] [Commented] (TRAFODION-3131) Use of reserved words as names fails in many places
[ https://issues.apache.org/jira/browse/TRAFODION-3131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16534094#comment-16534094 ] David Wayne Birdsall commented on TRAFODION-3131: - Note: The CREATE TABLE example with RANGE SPLIT BY syntax is supported only in a derived product at the moment and not in Trafodion itself; I should not have included it as a test example in this JIRA. > Use of reserved words as names fails in many places > --- > > Key: TRAFODION-3131 > URL: https://issues.apache.org/jira/browse/TRAFODION-3131 > Project: Apache Trafodion > Issue Type: Bug > Components: sql-cmp >Affects Versions: 2.3 >Reporter: David Wayne Birdsall >Assignee: David Wayne Birdsall >Priority: Major > Attachments: jira.sql.txt > > > It should be possible to use a reserved word (e.g., "YEAR") as an identifier > if it is made into a delimited identifier (that is, upper-cased and > surrounded with double-quotes). The sqlci session below demonstrates several > examples where this fails: > {quote}>>obey jira.sql; > >>-- script to reproduce various problems with reserved words > >> > >>?section tablename > >> > >>-- reserved word as a table name fails in various places > >> > >>create table "DELETE" (c1 int); > --- SQL operation complete. > >>invoke "DELETE"; > *** ERROR[15001] A syntax error occurred at or before: > TABLE TRAFODION.SCH.DELETE; > ^ (26 characters from start of SQL statement) > *** ERROR[15001] A syntax error occurred at or before: > TABLE ; > ^ (7 characters from start of SQL statement) > *** ERROR[8822] The statement was not prepared. > >>showddl "DELETE"; > CREATE TABLE TRAFODION.SCH.DELETE > ( > C1 INT DEFAULT NULL NOT SERIALIZED > ) > ATTRIBUTES ALIGNED FORMAT > ; > -- GRANT SELECT, INSERT, DELETE, UPDATE, REFERENCES ON TRAFODION.SCH.DELETE > TO DB__ROOT WITH GRANT OPTION; > --- SQL operation complete. > >>insert into "DELETE" values (1); > *** ERROR[8448] Unable to access Hbase interface. Call to > ExpHbaseInterface::checkAndInsertRow returned error HBASE_ACCESS_ERROR(-706). > Cause: java.lang.IllegalArgumentException: Table qualifier must not be empty > org.apache.hadoop.hbase.TableName.isLegalTableQualifierName(TableName.java:179) > org.apache.hadoop.hbase.TableName.isLegalTableQualifierName(TableName.java:149) > org.apache.hadoop.hbase.TableName.(TableName.java:322) > org.apache.hadoop.hbase.TableName.createTableNameIfNecessary(TableName.java:358) > org.apache.hadoop.hbase.TableName.valueOf(TableName.java:418) > org.apache.hadoop.hbase.client.HTable.(HTable.java:274) > org.apache.hadoop.hbase.client.transactional.TransactionalTable.(TransactionalTable.java:138) > org.apache.hadoop.hbase.client.transactional.RMInterface.(RMInterface.java:159) > org.trafodion.sql.HTableClient.init(HTableClient.java:348) > org.trafodion.sql.HBaseClient.getHTableClient(HBaseClient.java:1008) > org.trafodion.sql.HBaseClient.insertRow(HBaseClient.java:1964). > --- 0 row(s) inserted. > >>delete from "DELETE" where c1=1; > *** ERROR[8448] Unable to access Hbase interface. Call to > ExpHbaseInterface::scanOpen returned error HBASE_OPEN_ERROR(-704). Cause: > java.lang.IllegalArgumentException: Table qualifier must not be empty > org.apache.hadoop.hbase.TableName.isLegalTableQualifierName(TableName.java:179) > org.apache.hadoop.hbase.TableName.isLegalTableQualifierName(TableName.java:149) > org.apache.hadoop.hbase.TableName.(TableName.java:322) > org.apache.hadoop.hbase.TableName.createTableNameIfNecessary(TableName.java:358) > org.apache.hadoop.hbase.TableName.valueOf(TableName.java:418) > org.apache.hadoop.hbase.client.HTable.(HTable.java:274) > org.apache.hadoop.hbase.client.transactional.TransactionalTable.(TransactionalTable.java:138) > org.apache.hadoop.hbase.client.transactional.RMInterface.(RMInterface.java:159) > org.trafodion.sql.HTableClient.init(HTableClient.java:348) > org.trafodion.sql.HBaseClient.getHTableClient(HBaseClient.java:1008). > --- 0 row(s) deleted. > >>update "DELETE" set c1=2 where c1=1; > *** ERROR[8448] Unable to access Hbase interface. Call to > ExpHbaseInterface::scanOpen returned error HBASE_OPEN_ERROR(-704). Cause: > java.lang.IllegalArgumentException: Table qualifier must not be empty > org.apache.hadoop.hbase.TableName.isLegalTableQualifierName(TableName.java:179) > org.apache.hadoop.hbase.TableName.isLegalTableQualifierName(TableName.java:149) > org.apache.hadoop.hbase.TableName.(TableName.java:322) > org.apache.hadoop.hbase.TableName.createTableNameIfNecessary(TableName.java:358) > org.apache.hadoop.hbase.TableName.valueOf(TableName.java:418) > org.apache.hadoop.hbase.client.HTable.(HTable.java:274) > org.apache.hadoop.hbase.client.transactional.TransactionalTable.(TransactionalTable.java:138) >