hbase_cmp()

Read(2882) Label: hbase comparator,

Description:

Compare data with the HBase-supplied comparator.

Syntax:

hbase_cmp(str[,r][,b]) 

Note:

This external library function (See External Library Guide) compares the current value and the threshold with the HBase-supplied comparator.

Option:

@p

Match the current value with the prefix

@n

Check if the current value is null but won’t perform matching

@r

Use a regular expression to match table data

@s

Use the threshold and table data, both of which are string type, to match up a string

@l

Convert a string type or a date/time/datetime type parameter to a Long type one

@b

Perform bit-level comparison using AND, OR and XOR operations

Parameter:

str

A string

r

 

 

 

Only use this parameter with @r option; its value can only be one of the following letters:

i=case insensitive  (Case-insensitive)

m=multiline,  (^ and $ can match up a line break within a string)

d=dotall,  (The dot symbol can match up a line break)

u=unicode case,  (Case-insensitive in matching up Unicode characters )

q=canon_eq  (Consider same characters in different character encodings as equal)

x=unix_lines,  (Consider \n as a line break only)

l=literal,  (Text mode)

c=comments  (Comment mode)

The value must be in quotation marks

b

Only use this parameter with @b option; its value can only be one of the following: AND, OR, XOR; the value must be in quotation marks

Return value:

Comparator handle

Example:

 

A

 

1

=hbase_open("hdfs://192.168.0.8:9000")

 

2

=hbase_cmp("13")

 

3

=hbase_filter("ValueFilter","eq",A2)

 

4

=hbase_scan(A1,"emp";filter:A4)

5

=hbase_cmp@p("136")

 

6

=hbase_scan(A1,"emp";filter:hbase_filter("ValueFilter","eq",A5))

7

=hbase_cmp@r("J","i")

 

 

 

8

=hbase_scan(A1,"emp";filter:hbase_filter("ValueFilter","eq",A7))

9

=hbase_cmp@s("sp")

 

10

=hbase_scan(A1,"emp";filter:hbase_filter("SingleColumnValueFilter","company","name","=",A9))

Related function:

hbase_open()

hbase_filter()

hbase_scan()