Created 12-17-2015 07:35 AM
Hey Guys,
Is it possible to create hive database name in UPPERCASE ?
hive> create database KULDEEP; hive> show databases; OK default kuldeep test Time taken: 0.464 seconds, Fetched: 3 row(s)
Created 12-18-2015 09:22 AM
helped me to find answer of this question.
As per code it always converts given database name in lowercase format
Answer of this questions is - Database names in hive will always be in lowecase.
https://svn.apache.org/repos/asf/hive/trunk/metast...
@Override public void createDatabase(Database db) throws InvalidObjectException, MetaException { boolean commited = false; MDatabase mdb = new MDatabase(); mdb.setName(db.getName().toLowerCase()); mdb.setLocationUri(db.getLocationUri()); mdb.setDescription(db.getDescription()); mdb.setParameters(db.getParameters()); mdb.setOwnerName(db.getOwnerName()); PrincipalType ownerType = db.getOwnerType(); mdb.setOwnerType((null == ownerType ? PrincipalType.USER.name() : ownerType.name())); try { openTransaction(); pm.makePersistent(mdb); commited = commitTransaction(); } finally { if (!commited) { rollbackTransaction(); } } }
Created 12-17-2015 08:49 AM
As far as I can tell it is not possible. See this Jira https://issues.apache.org/jira/browse/HIVE-7689
Created 12-17-2015 11:45 AM
Not possible as of now. I just ran few tests but nothing.
Created 12-18-2015 09:19 AM
Thanks @Neeraj Sabharwal
Created 12-18-2015 09:22 AM
helped me to find answer of this question.
As per code it always converts given database name in lowercase format
Answer of this questions is - Database names in hive will always be in lowecase.
https://svn.apache.org/repos/asf/hive/trunk/metast...
@Override public void createDatabase(Database db) throws InvalidObjectException, MetaException { boolean commited = false; MDatabase mdb = new MDatabase(); mdb.setName(db.getName().toLowerCase()); mdb.setLocationUri(db.getLocationUri()); mdb.setDescription(db.getDescription()); mdb.setParameters(db.getParameters()); mdb.setOwnerName(db.getOwnerName()); PrincipalType ownerType = db.getOwnerType(); mdb.setOwnerType((null == ownerType ? PrincipalType.USER.name() : ownerType.name())); try { openTransaction(); pm.makePersistent(mdb); commited = commitTransaction(); } finally { if (!commited) { rollbackTransaction(); } } }