Index: src/main/java/org/apache/hadoop/hbase/master/HMaster.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/master/HMaster.java (revision 1329320) +++ src/main/java/org/apache/hadoop/hbase/master/HMaster.java (working copy) @@ -1225,8 +1225,13 @@ byte[][] splitKeys) { HRegionInfo[] hRegionInfos = null; if (splitKeys == null || splitKeys.length == 0) { - hRegionInfos = new HRegionInfo[]{ - new HRegionInfo(hTableDescriptor.getName(), null, null)}; + hRegionInfos = new HRegionInfo[] { new HRegionInfo(hTableDescriptor + .getName(), null, null) }; + } else if (splitKeys != null && splitKeys.length == 1) { + if (Bytes.compareTo(splitKeys[0], HConstants.EMPTY_BYTE_ARRAY) == 0) { + hRegionInfos = new HRegionInfo[] { new HRegionInfo(hTableDescriptor + .getName(), null, null) }; + } } else { int numRegions = splitKeys.length + 1; hRegionInfos = new HRegionInfo[numRegions]; Index: src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java =================================================================== --- src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java (revision 1329320) +++ src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java (working copy) @@ -715,6 +715,18 @@ } ladmin.close(); } + + @Test + public void testCreateTableWithOnlyEmptyStartRow() throws IOException { + byte[] tableName = Bytes.toBytes("testCreateTableWithOnlyEmptyStartRow"); + byte[][] splitKeys = new byte[1][]; + splitKeys[0] = HConstants.EMPTY_BYTE_ARRAY; + HTableDescriptor desc = new HTableDescriptor(tableName); + desc.addFamily(new HColumnDescriptor("col")); + admin.createTable(desc, splitKeys); + List tableRegions = admin.getTableRegions(tableName); + assertEquals("The number of regions should be one.", 1, tableRegions.size()); + } @Test public void testTableExist() throws IOException {