adaltas / node-hbase

Asynchronous HBase client for NodeJs using REST

Home Page:https://hbase.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SingleColumnValueFilter Syntax

mithralaya opened this issue · comments

Hello David,

Could you please help me get the syntax right for the following query.

scanner = client
            .table('UserLog')
            .scan({
                //startRow: '1437696000000',
                //maxVersions: 1,
                filter: {
                    "op": "MUST_PASS_ALL",
                    "type": "FilterList",
                    "filters": [
                        {
                            "op": "EQUAL",
                            "type": "SingleColumnValueFilter",
                            "family": "entry",
                            "qualifier": "merchantId",
                            "comparator": {
                                "value": "30",
                                "type": "BinaryComparator"
                            },
                            "ifMissing": true,
                            "latestVersion": true
                        },
                        {
                            "op": "EQUAL",
                            "type": "SingleColumnValueFilter",
                            "family": "entry",
                            "qualifier": "tag",
                            "comparator": {
                                "value": "CloseOut, Transaction",
                                "type": "BinaryComparator"
                            },
                            "ifMissing": true,
                            "latestVersion": true
                        },
                        {
                            "op": "GREATER_OR_EQUAL",
                            "type": "SingleColumnValueFilter",
                            "family": "entry",
                            "qualifier": "addedTime",
                            "comparator": {
                                "value": "1437696000000",
                                "type": "BinaryComparator"
                            },
                            "ifMissing": true,
                            "latestVersion": true
                        },
                        {
                            "op": "LESS_OR_EQUAL",
                            "type": "SingleColumnValueFilter",
                            "family": "entry",
                            "qualifier": "addedTime",
                            "comparator": {
                                "value": "1437764400000",
                                "type": "BinaryComparator"
                            },
                            "ifMissing": true,
                            "latestVersion": true
                        }
                    ]
                }
            });

Many thanks,
Karthik

Thats a tuff one, getting this right isnt easy as not every filter are supported and implented the same (some need encoding, other dont) and i didnt try all of them

Old issue, closing.