在表和列名中,配置单元似乎不支持unicode。例如,我无法在配置单元中创建具有西里尔文列名的表(请参见下面的异常)。有没有办法让配置单元使用西里尔字母表和列名?
我使用:
$ hadoop version
Hadoop 2.2.0.2.0.6.0-101
Subversion git@github.com:hortonworks/hadoop.git -r b07b2906c36defd389c8b5bd22bebc1bead8115b
Compiled by jenkins on 2014-01-09T05:18Z
Compiled with protoc 2.5.0
hive> CREATE TABLE test2(`Имя` STRING, `НомерТелефона` INT);
NoViableAltException(10@[])
at org.apache.hadoop.hive.ql.parse.HiveParser.type(HiveParser.java:27461)
at org.apache.hadoop.hive.ql.parse.HiveParser.colType(HiveParser.java:27229)
at org.apache.hadoop.hive.ql.parse.HiveParser.columnNameType(HiveParser.java:26935)
at org.apache.hadoop.hive.ql.parse.HiveParser.columnNameTypeList(HiveParser.java:25185)
at org.apache.hadoop.hive.ql.parse.HiveParser.createTableStatement(HiveParser.java:4264)
at org.apache.hadoop.hive.ql.parse.HiveParser.ddlStatement(HiveParser.java:2016)
at org.apache.hadoop.hive.ql.parse.HiveParser.execStatement(HiveParser.java:1298)
at org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:938)
at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:190)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:424)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:342)
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1000)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:911)
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:259)
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:216)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:413)
at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:781)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:675)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:614)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
FAILED: ParseException line 1:31 cannot recognize input near ',' 'INT' ')' in column type
2条答案
按热度按时间yc0p9oo01#
可以对数据/注解使用unicode字符串,但不能对数据库/表/列名使用。
请看这里:https://cwiki.apache.org/confluence/display/hive/user+faq#userfaq-支持Unicode吗?
nfzehxib2#
配置单元0.13支持带引号的unicode列名。详见hive-6013。hadoop2.2包含hive0.11,因此更新到hadoop2.4或更高版本以获得此功能。