You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Charles Bonneau <ch...@euranova.eu> on 2014/09/26 12:17:48 UTC

WebHCat can't display table with number name


Hello,

We are using Hive 0.12.
While using WebHCat, I stumbled upon a problem regarding the name of
tables.
We generate table names according to Hive’s documentation :
“ In Hive 0.12 and earlier, only alphanumeric and underscore
characters are allowed in table and column names.”

However, when trying to access such table “85121f8b5b” from
WebHCat using this URL :
http://server:port/templeton/v1/ddl/database/default/table/85121f8b5b
is get this error :
{"error":"Invalid DDL identifier :table"}

So I dug into the code of WebHCat and I found this (in the class
org.apache.hive.hcatalog.templeton.Server.java, which might not be up
to date btw):

public static final Pattern DDL_ID = Pattern.compile
[1]("[a-zA-Z]\\w*");

  /**
   * Verify that the parameter exists and is a simple DDL identifier
   * name.  Throw an exception if invalid.
   *
   * Bug: This needs to allow for quoted ddl identifiers.
   */
  public void verifyDdlParam(String param, String name)
    throws BadParam {
    verifyParam(param, name);
    Matcher m = DDL_ID.matcher(param);
    if (!m.matches()) {
      throw new BadParam("Invalid DDL identifier " + name);
    }
  }

The pattern DDL_ID clearly doesn’t match Hive’s documentation for
table names.

What can we do to solve this issue ?

Best regards,

Charles Bonneau
Software Engineer
(M) +32 492 58 72 50

EURA NOVA
Rue Emile Francqui, 4
1435 Mont-Saint-Guibert
(T) +32 10 75 02 00

euranova.eu


Links:
------
[1] http://Pattern.compile


Re: WebHCat can't display table with number name

Posted by Thejas Nair <th...@hortonworks.com>.
This is a bug. Would you mind opening a hive jira for this ? If you
can provide a patch as well, I will be happy to review it.



On Fri, Sep 26, 2014 at 3:17 AM, Charles Bonneau
<ch...@euranova.eu> wrote:
>
> Hello,
>
> We are using Hive 0.12.
> While using WebHCat, I stumbled upon a problem regarding the name of tables.
> We generate table names according to Hive’s documentation :
> “ In Hive 0.12 and earlier, only alphanumeric and underscore characters are
> allowed in table and column names.”
>
> However, when trying to access such table “85121f8b5b” from WebHCat using
> this URL :
> http://server:port/templeton/v1/ddl/database/default/table/85121f8b5b is get
> this error :
> {"error":"Invalid DDL identifier :table"}
>
> So I dug into the code of WebHCat and I found this (in the class
> org.apache.hive.hcatalog.templeton.Server.java, which might not be up to
> date btw):
>
> public static final Pattern DDL_ID = Pattern.compile("[a-zA-Z]\\w*");
>
>   /**
>    * Verify that the parameter exists and is a simple DDL identifier
>    * name.  Throw an exception if invalid.
>    *
>    * Bug: This needs to allow for quoted ddl identifiers.
>    */
>   public void verifyDdlParam(String param, String name)
>     throws BadParam {
>     verifyParam(param, name);
>     Matcher m = DDL_ID.matcher(param);
>     if (!m.matches()) {
>       throw new BadParam("Invalid DDL identifier " + name);
>     }
>   }
>
> The pattern DDL_ID clearly doesn’t match Hive’s documentation for table
> names.
>
> What can we do to solve this issue ?
>
> Best regards,
>
> Charles Bonneau
> Software Engineer
> (M) +32 492 58 72 50
>
> EURA NOVA
> Rue Emile Francqui, 4
> 1435 Mont-Saint-Guibert
> (T) +32 10 75 02 00
>
> euranova.eu

-- 
CONFIDENTIALITY NOTICE
NOTICE: This message is intended for the use of the individual or entity to 
which it is addressed and may contain information that is confidential, 
privileged and exempt from disclosure under applicable law. If the reader 
of this message is not the intended recipient, you are hereby notified that 
any printing, copying, dissemination, distribution, disclosure or 
forwarding of this communication is strictly prohibited. If you have 
received this communication in error, please contact the sender immediately 
and delete it from your system. Thank You.