[
https://issues.apache.org/jira/browse/HBASE-17212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15709188#comment-15709188
]
Yu Li commented on HBASE-17212:
-------------------------------
Test and confirmed empty table name is caught and handled in
{{TableName#valueOf}} method. If we run below code:
{code}
Table table = connection.getTable(TableName.valueOf(""));
{code}
we will get below exception
{noformat}
java.lang.IllegalArgumentException: Table qualifier must not be empty
at
org.apache.hadoop.hbase.TableName.isLegalTableQualifierName(TableName.java:179)
at
org.apache.hadoop.hbase.TableName.isLegalTableQualifierName(TableName.java:149)
at org.apache.hadoop.hbase.TableName.<init>(TableName.java:322)
at
org.apache.hadoop.hbase.TableName.createTableNameIfNecessary(TableName.java:358)
at org.apache.hadoop.hbase.TableName.valueOf(TableName.java:445)
{noformat}
> Should add null checker on table name in HTable constructor
> -----------------------------------------------------------
>
> Key: HBASE-17212
> URL: https://issues.apache.org/jira/browse/HBASE-17212
> Project: HBase
> Issue Type: Improvement
> Affects Versions: 2.0.0
> Reporter: Yu Li
> Assignee: Yu Li
>
> If we run below codes:
> {code}
> Table table = connection.getTable(null);
> {code}
> we will see below exception:
> {noformat}
> java.lang.NullPointerException
> at org.apache.hadoop.hbase.client.HTable.finishSetup(HTable.java:221)
> at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:182)
> at
> org.apache.hadoop.hbase.client.ConnectionImplementation.getTable(ConnectionImplementation.java:298)
> at
> org.apache.hadoop.hbase.client.ConnectionImplementation.getTable(ConnectionImplementation.java:293)
> {noformat}
> And in this JIRA we will add a null checker and throw a more graceful
> {{IllegalArgumentException}}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)