-Re: Hive doesn't support special characters in column name
Edward Capriolo 2013-10-08, 23:55
It is fairly common not to allow variable names to begin with an _. Also
many frameworks like thrift and protobuf have similar rules. Compilers have
similar rules as well.
It is not going to be an easy change to make, spaces are bad for sure. It
is probably easier to write some code to map special characters to
On Tue, Oct 8, 2013 at 6:29 PM, Zhang Xiaoyu <[EMAIL PROTECTED]>wrote:
> Thanks, Nitin,
> If I modify the antlr file to allow column name accept those special
> characters. What side effect potentially could be ? Will it possible break
> the query parsing?
> On Tue, Oct 8, 2013 at 12:09 PM, Nitin Pawar <[EMAIL PROTECTED]>wrote:
>> In hive the column names are restricted by alpha-numeric and _ (and not
>> beginning with _)
>> Why it was done ? For my understanding, to avoid the unnecessary
>> complexity in query parsing or grammer building.
>> hive dev will have definite answer :)
>> On Tue, Oct 8, 2013 at 11:56 PM, Zhang Xiaoyu <[EMAIL PROTECTED]>wrote:
>>> The columns in my Hive table had better include some special characters
>>> like / # -
>>> However, I found Hive doesn't allow it, and doesn't allow using \ as
>>> escape character.
>>> all below query fail
>>> create table test ( "user\/hive" String);
>>> create table test ( "user\\/hive" String);
>>> create table test ( user\/hive String);
>>> create table test ( user\\/hive String);
>>> create table test ( user/hive String);
>>> also, although Hive does allow _ in column name, but it doesn't special
>>> character as begging of the column name
>>> this query fail:
>>> create table test ( _user_hive String);
>>> this is OK:
>>> create table test ( "user_hive" String);
>>> any idea?
>> Nitin Pawar