hbaseimportjob:尽管列族存在,但找不到它

r7s23pms  于 2021-06-09  发布在  Hbase
关注(0)|答案(0)|浏览(318)

嗨,我在将数据从配置单元复制到hbase时遇到了一个问题。
我使用apachesqoop的hbaseimportjob。找不到列族。尽管表说明中存在列族

NAME => 'temp_table', FAMILIES => [{NAME => 'cf', BLOOMFILTER => 'ROW', REPLICATION_SCOPE => '1', V true                                                       
 ERSIONS => '3', COMPRESSION => 'NONE', MIN_VERSIONS => '0', TTL => '2147483647', BLOCKSIZE => '65536', IN_ME                                                            
 MORY => 'false', BLOCKCACHE => 'true'}]}

出现错误的代码部分是:

// Check to see if the table exists.
    HTableDescriptor tableDesc = null;
    byte [] familyBytes = Bytes.toBytes(familyName);
    HColumnDescriptor colDesc = new HColumnDescriptor(familyBytes);
    if (!admin.tableExists(tableName)) {
        if (options.getCreateHBaseTable()) {
            // Create the table.
            LOG.info("Creating missing HBase table " + tableName);
            tableDesc =  new HTableDescriptor(tableName);
            tableDesc.addFamily(colDesc);
            admin.createTable(tableDesc);
        } else {
            LOG.warn("Could not find HBase table " + tableName);
            LOG.warn("This job may fail. Either explicitly create the table,");
            LOG.warn("or re-run with --hbase-create-table.");
        }
    } else {
        // Table exists, so retrieve their current version
        tableDesc = admin.getTableDescriptor(Bytes.toBytes(tableName));
        // Check if current version do have specified column family
        if (!tableDesc.hasFamily(familyBytes)) {
            if (options.getCreateHBaseTable()) {
                // Create the column family.
                LOG.info("Creating missing column family " + familyName);
                admin.disableTable(tableName);
                admin.addColumn(tableName, colDesc);
                admin.enableTable(tableName);
            } else {
                LOG.warn("Could not find column family " + familyName + " in table "
                    + tableName);
                LOG.warn("This job may fail. Either create the column family,");
                LOG.warn("or re-run with --hbase-create-table.");
            }
        }
    }

我得到以下错误:

2015-04-05 23:38:58,643 WARN org.apache.sqoop.mapreduce.HBaseImportJob: Could not find column family cf in table temp_table
2015-04-05 23:38:58,643 WARN org.apache.sqoop.mapreduce.HBaseImportJob: This job may fail. Either create the column family,
2015-04-05 23:38:58,643 WARN org.apache.sqoop.mapreduce.HBaseImportJob: or re-run with --hbase-create-table

你知道吗?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题