hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jeff saremi <jeffsar...@hotmail.com>
Subject Re: Baffling situation with tableExists and createTable
Date Tue, 25 Apr 2017 23:09:20 GMT
BTW on the page
there is no sign of the supposedly existing table either

From: jeff saremi <jeffsaremi@hotmail.com>
Sent: Tuesday, April 25, 2017 4:05:56 PM
To: user@hbase.apache.org
Subject: Baffling situation with tableExists and createTable

I have a super simple piece of code which tries to create a test table if it does not exist

calling admin.tableExists(TableName.valueOf(table)) returns false causing the control to be
passed to the line that creates it admin.createTable(tableDescriptor). Then i get an exception
that the table exists!

Exception in thread "main" org.apache.hadoop.hbase.TableExistsException: LoadTest

String table = config.tableName;
Connection conn = ConnectionFactory.createConnection(hbaseconf);
Admin admin = conn.getAdmin();
if(!admin.tableExists(TableName.valueOf(table))) {
    Log.info("table " + table + " does not exist. Creating it...");
    HTableDescriptor tableDescriptor = new HTableDescriptor(TableName.valueOf(table));
    tableDescriptor.addFamily(new HColumnDescriptor(config.FAMILY));


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message