0

样品表

hbase(main):026:0> 扫描“数据表”

行列+单元格

key1 列=cf1:col1,时间戳=1465135446446,值=value1

key1 列=cf1:col2,时间戳=1465135452934,值=value1

key2 列=cf2:col1,时间戳=1465135471613,值=value2

key2 列=cf2:col2,时间戳=1465135481068,值=value2

key3 列=cf1:col1,时间戳=1465137223212,值=value3

key3 列=cf2:col2,时间戳=1465137232291,值=value3

0.0300 秒内 3 行

询问

过滤满足以下任一条件的行,

行键是“key1”,列是 {cf1:col1}

或者

列是 {cf2:col2}

预期产出

行列+单元格

key1 列=cf1:col1,时间戳=1465135446446,值=value1

key2 列=cf2:col2,时间戳=1465135481068,值=value2

key3 列=cf2:col2,时间戳=1465137232291,值=value3

4

1 回答 1

1

Base64 等效

cf1 => Y2Yx

col1 => Y29sMQ==

key1 => a2V5MQ==

cf2=> Y2Yy

col2 => Y29sMg==

操作员(操作):LESS,LESS_OR_EQUAL,EQUAL,NOT_EQUAL,GREATER_OR_EQUAL,GREATER,NO_OP;

过滤器列表(操作):MUST_PASS_ALL,MUST_PASS_ONE

{
    “类型”:“过滤器列表”,
    "op": "MUST_PASS_ONE",
    “过滤器”:[{
        “类型”:“过滤器列表”,
        "op": "MUST_PASS_ALL",
        “过滤器”:[{
            "type": "FamilyFilter",
            "op": "相等",
            “比较器”:{
                "type": "BinaryComparator",
                “值”:“Y2Yx”
            }
        }, {
            "type": "QualifierFilter",
            "op": "相等",
            “比较器”:{
                "type": "BinaryComparator",
                “值”:“Y29sMQ ==”
            }
        }, {
            “类型”:“行过滤器”,
            "op": "相等",
            “比较器”:{
                "type": "BinaryComparator",
                “价值”:“a2V5MQ==
            }
        }]
    }, {
        “类型”:“过滤器列表”,
        "op": "MUST_PASS_ALL",
        “过滤器”:[{
            "type": "FamilyFilter",
            "op": "相等",
            “比较器”:{
                "type": "BinaryComparator",
                “值”:“Y2Yy”
            }
        }, {
            "type": "QualifierFilter",
            "op": "相等",
            “比较器”:{
                "type": "BinaryComparator",
                “值”:“Y29sMg==
            }
        }]
    }]
}

$ curl -i -H "Content-Type: text/xml" -d @complex_filter.txt http://shva1.hwxblr.com:9292/datatable/scanner

HTTP/1.1 201 创建位置:http ://shva1.hwxblr.com:9292/datatable/scanner/146513894809742c1664a

样本输出

$ curl -i -H "接受:应用程序/json" http://shva1.hwxblr.com:9292/datatable/scanner/146513894809742c1664a

{"行":[{"key":"a2V5MQ==","Cell":[{"column":"Y2YxOmNvbDE=","timestamp":1465135446446,"$":"dmFsdWUx"}]},{ "key":"a2V5Mg==","Cell":[{"column":"Y2YyOmNvbDI=","timestamp":1465135481068,"$":"dmFsdWUy"}]},{"key":"a2V5Mw= =","单元格":[{"column":"Y2YyOmNvbDI=","timestamp":1465137232291,"$":"dmFsdWUz"}]}]}

于 2016-06-05T17:10:19.877 回答