hbase_cmp()

Read(283) Label: hbase comparator,

Description:

Compare data with the HBase-supplied comparator.

Syntax:

hbase_cmp(str[,r][,b])  Compare the current value with the threshold

Note:

This external library function compares data with the HBase-supplied comparator.

Options:

@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/datatime type parameter to a Long type one

@b

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

Parameters:

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", "192.168.0.8")

 

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 functions:

  hbase_open()

hbase_filter()

hbase_scan()