Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/131.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Thrift c+;获取Hbase中具有空列(不存在)的行+; 在Hbase,我需要使用节俭C++来获得一个空列(不存在)的行。有些行有此列,有些行没有_C++_Null_Hbase_Thrift_Isnull - Fatal编程技术网

使用Thrift c+;获取Hbase中具有空列(不存在)的行+; 在Hbase,我需要使用节俭C++来获得一个空列(不存在)的行。有些行有此列,有些行没有

使用Thrift c+;获取Hbase中具有空列(不存在)的行+; 在Hbase,我需要使用节俭C++来获得一个空列(不存在)的行。有些行有此列,有些行没有,c++,null,hbase,thrift,isnull,C++,Null,Hbase,Thrift,Isnull,我有以下带有过滤器的代码,它工作得很好,但是我怎么能得到不存在列的行呢 /* Connection to the thrift server */ boost::shared_ptr<TSocket> socket(new TSocket("localhost", 9090)); boost::shared_ptr<TTransport> transport(new TBufferedTransport(socket)); boost::shared_ptr<TPr

我有以下带有过滤器的代码,它工作得很好,但是我怎么能得到不存在列的行呢

/* Connection to the thrift server */
boost::shared_ptr<TSocket> socket(new TSocket("localhost", 9090));
boost::shared_ptr<TTransport> transport(new TBufferedTransport(socket));
boost::shared_ptr<TProtocol> protocol(new TBinaryProtocol(transport));

/* Creating the Hbase client*/
HbaseClient client(protocol);

try
{
    /* Open the client transport*/
    transport->open();

    /* The table name */
    std::string t("sometable");

/* Open the scanner: need to scan with a filter*/
StrVec columnNames;
StrMap atr_test;
TScan tscan;
std::string filterStr;
filterStr = "SingleColumnValueFilter('ColumnFamily', 'ColumnQualifier', =, 'substring:value', true, false)";
tscan.__set_filterString(filterStr);

int scanner = client.scannerOpenWithScan(t, tscan, atr_test);

while (true) {
    std::vector<TRowResult> value;
    client.scannerGet(value, scanner);
        // Print value
        for (CellMap::const_iterator it = value[0].columns.begin(); it != value[0].columns.end(); ++it) {
            std::cout << "     " << it->first << " => " << it->second.value << ";\n";
        }

    }
}
/*与thrift服务器的连接*/
boost::共享的ptr套接字(新的TSocket(“localhost”,9090));
boost::共享ptr传输(新的TBufferedTransport(套接字));
boost::共享ptr协议(新的TBinaryProtocol(传输));
/*创建Hbase客户端*/
HbaseClient客户端(协议);
尝试
{
/*打开客户端传输*/
传输->打开();
/*表名*/
std::字符串t(“sometable”);
/*打开扫描仪:需要使用过滤器进行扫描*/
StrVec列名称;
StrMap atr_试验;
TScan TScan;
std::字符串过滤器tr;
filterStr=“SingleColumnValueFilter('ColumnFamily','ColumnQualifier',=,'substring:value',true,false)”;
t扫描设置过滤器串(过滤器TR);
int scanner=客户端.scannerOpenWithScan(t、tscan、atr_测试);
while(true){
std::向量值;
client.scannerGet(值,scanner);
//打印值
对于(CellMap::const_迭代器it=value[0]。columns.begin();it!=value[0]。columns.end();+it){

你可以使用空比较器吗。