[ https://issues.apache.org/jira/browse/CARBONDATA-332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15621965#comment-15621965 ] ASF GitHub Bot commented on CARBONDATA-332: ------------------------------------------- GitHub user lion-x opened a pull request: https://github.com/apache/incubator-carbondata/pull/273 [CARBONDATA-332] Prohibit to use reserved words in database\table\col name # Why raise this PR? Carbon should prohibit to use reserved words in database\table\col name. Using reserved words will cause many unnecessary troubles. # How to solve? Adding reserved words validation for database, table, cols when they are creating. # How to test? Pass all test cases. You can merge this pull request into a Git repository by running: $ git pull https://github.com/lion-x/incubator-carbondata prohibitReserved Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-carbondata/pull/273.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 #273 ---- commit fc7a7bb7e7a8df5f3abc5e8b1b3b9c0804226869 Author: lion-x <[hidden email]> Date: 2016-10-31T11:46:07Z validateCarbonReservedKeywords ---- > Create successfully Database, tables and columns using carbon reserve keywords > ------------------------------------------------------------------------------ > > Key: CARBONDATA-332 > URL: https://issues.apache.org/jira/browse/CARBONDATA-332 > Project: CarbonData > Issue Type: Bug > Reporter: Harmeet Singh > Assignee: Lionx > > Hey team, I am trying to create database, tables and columns with carbon reserve keywords name and carbon allow us for creating. I am expecting an error. In hive, we are facing an error. Following are the steps : > Step1: > 0: jdbc:hive2://127.0.0.1:10000> create database double; > +---------+--+ > | result | > +---------+--+ > +---------+--+ > No rows selected (6.225 seconds) > Step 2: > 0: jdbc:hive2://127.0.0.1:10000> use double; > +---------+--+ > | result | > +---------+--+ > +---------+--+ > No rows selected (0.104 seconds) > Step 3: > 0: jdbc:hive2://127.0.0.1:10000> create table decimal(int int, string string) stored by 'carbondata'; > +---------+--+ > | Result | > +---------+--+ > +---------+--+ > No rows selected (2.372 seconds) > Step 4: > 0: jdbc:hive2://127.0.0.1:10000> show tables; > +------------+--------------+--+ > | tableName | isTemporary | > +------------+--------------+--+ > | decimal | false | > +------------+--------------+--+ > 1 row selected (0.071 seconds) > Step 5: > 0: jdbc:hive2://127.0.0.1:10000> desc decimal; > +-----------+------------+----------+--+ > | col_name | data_type | comment | > +-----------+------------+----------+--+ > | string | string | | > | int | bigint | | > +-----------+------------+----------+--+ > 2 rows selected (0.556 seconds) > Step 6: > 0: jdbc:hive2://127.0.0.1:10000> load data inpath 'hdfs://localhost:54310/home/harmeet/reservewords.csv' into table decimal; > +---------+--+ > | Result | > +---------+--+ > +---------+--+ > No rows selected (0.863 seconds) > Step 7: > 0: jdbc:hive2://127.0.0.1:10000> select * from decimal; > +---------+------+--+ > | string | int | > +---------+------+--+ > | james | 10 | > +---------+------+--+ > 1 row selected (0.413 seconds) -- This message was sent by Atlassian JIRA (v6.3.4#6332) |
Free forum by Nabble | Edit this page |