Thanks Jander.

Not supporting "-" in database/table names is fine,  we can work around that. 
What about usernames? Like I said, our main problem is that we have a user with 
a hyphenated username – and I would like to figure out if there is a "clean" 
way to add him to a certain role, or assign him specific privileges using a 
grant statement (see the 2nd example).

I have figured out a hacky way to do this, which is to update the metastore 
directly – the DB_PRIVS and ROLE_MAPS tables can be updated directly for this 
particular user. But I was hoping to use the Hive command-line, and not update 
the metastore directly.

Cheers,
Sriram

ps: Not a huge deal, but is there a reason why Hive won't support hyphens in 
database/table names?

From: Jander g <jande...@gmail.com<mailto:jande...@gmail.com>>
Reply-To: "user@hive.apache.org<mailto:user@hive.apache.org>" 
<user@hive.apache.org<mailto:user@hive.apache.org>>
Date: Mon, 31 Oct 2011 23:05:13 -0700
To: "user@hive.apache.org<mailto:user@hive.apache.org>" 
<user@hive.apache.org<mailto:user@hive.apache.org>>
Subject: Re: Handling hyphens in table/database/usernames

Hive does not support '-' as a database name, which pattern is "[\\w_]+", so 
you can use '_' instead

On Tue, Nov 1, 2011 at 9:29 AM, Sriram Krishnan 
<skrish...@netflix.com<mailto:skrish...@netflix.com>> wrote:
Hi,

Does anyone know how to handle hyphens in any of the following? Specifically, 
we have a user with a hyphenated username – and I can't figure out a way to add 
him to a certain role. No amount of escaping my hyphen seems to help. I am 
using Hive version 0.7.1.

Any ideas would be appreciated.

Thanks,
Sriram

hive> create database if not exists sri-krish;
FAILED: Parse Error: line 1:33 mismatched input '-' expecting EOF near 'sri'

hive> grant all on database default to user sri-krish;
FAILED: Parse Error: line 1:41 mismatched input '-' expecting EOF near 'sri'




--
Thanks,
Jander

Reply via email to