You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@carbondata.apache.org by Harmeet Singh <ha...@knoldus.com> on 2016/10/19 12:11:23 UTC

Create table with reserve keywords created successfully

Hey Team,

I am trying to create a table using reserve keywords in *carbondata* like
int, string etc. But i am expecting an error after executing the query, but
table create successful. Below is the detail: 

0: jdbc:hive2://127.0.0.1:10000> create table int (int int, string string)
stored by 'carbondata';
+---------+--+
| Result  |
+---------+--+
+---------+--+
No rows selected (0.726 seconds)
0: jdbc:hive2://127.0.0.1:10000> desc int;
+-----------+------------+----------+--+
| col_name  | data_type  | comment  |
+-----------+------------+----------+--+
| string    | string     |          |
| int       | bigint     |          |
+-----------+------------+----------+--+

But if I using hive, Hive throw an exception as below: 

hive> create table measure(age int, name string);
OK
Time taken: 10.923 seconds
hive> create table int (int int, string string);
FailedPredicateException(identifier,{useSQL11ReservedKeywordsForIdentifier()}?)
	at
org.apache.hadoop.hive.ql.parse.HiveParser_IdentifiersParser.identifier(HiveParser_IdentifiersParser.java:10924)
	at
org.apache.hadoop.hive.ql.parse.HiveParser.identifier(HiveParser.java:45850)
	at
org.apache.hadoop.hive.ql.parse.HiveParser_FromClauseParser.tableName(HiveParser_FromClauseParser.java:4813)
	at
org.apache.hadoop.hive.ql.parse.HiveParser.tableName(HiveParser.java:45886)
	at
org.apache.hadoop.hive.ql.parse.HiveParser.createTableStatement(HiveParser.java:5029)
	at
org.apache.hadoop.hive.ql.parse.HiveParser.ddlStatement(HiveParser.java:2640)
	at
org.apache.hadoop.hive.ql.parse.HiveParser.execStatement(HiveParser.java:1650)
	at
org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:1109)
	at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:202)
	at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
	at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:396)
	at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:308)
	at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1122)
	at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1170)
	at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1059)
	at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1049)
	at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:213)
	at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:165)
	at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:376)
	at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:736)
	at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:681)
	at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:621)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
	at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
FAILED: ParseException line 1:13 Failed to recognize predicate 'int'. Failed
rule: 'identifier' in table name

This seems like, carbon data have issue, because reserver words are not
allow for using. 

I already try this with table_name and column_name. Both side this is
creating an table and column. 



--
View this message in context: http://apache-carbondata-mailing-list-archive.1130556.n5.nabble.com/Create-table-with-reserve-keywords-created-successfully-tp2049.html
Sent from the Apache CarbonData Mailing List archive mailing list archive at Nabble.com.