cs.join ()

Description:

A foreign-key-style join between a cluster cursor and a record sequence.

Syntax:

cs.join(C:.,T:K,x:F,…; …;…)

Note:

The function matches foreign key field C, of cluster cursor cs with the key of parameter T to find corresponding records in table T. Add an F field represented by x, which is T’s field expression, to cs and return the original cluster cursor.

 

K can be omitted or represented by #. When omitted, K is T’s key by default; when written as #, K is the sequence number of a record of table T, which means foreign key numberization. Simply put, primary key values of the dimension table are natural numbers starting from 1, which are row numbers corresponding to table records. In this case, we can directly locate dimension table records according to key values by row numbers. This helps speed up association with the dimension table and increase performance.

 

If there is an F field in cs, just modify the existing field of ch. Use the latest time calculated through now() when time key value is not specified.

 

It supports the multicursor.

Option:

@c

With a distributed cluster table, the operation won’t involve a cross-node reference but it assumes that the referenced records are local

Parameter:

cs

A cursor/multicursor/cluster cursor

C

cs’s foreign key; separate multiple fields in a composite key with the colon

T

A cluster in-memory table

K

T’s key

x

T’s field expression

F

Name of T’s field expression

Return value:

Cursor

Example:

 

A

 

1

[192.168.18.143:8281]

 

2

=file("emp_1.ctx":[2], A1)

 

3

=A2.open()

 

4

=A3.cursor()

A cluster cursor.

5

[192.168.0.110:8281]

 

6

=file("PERFORMANCE.ctx":[1],A5)

 

7

=A6. open ()

 

8

=A7.cursor()

 

9

=A8.memory()

A cluster in-memory table.

10

=A4.join(EID,A9:EMPLOYEEID, BONUS*12:total)

Match EID field of A4’s cluster cursor with the key field EMPLOYEEID of A9’s cluster in-memory table, make the value of calculating expression BONUS*12 over the memory table’s total field and join it up with the cluster cursor, and return the cluster cursor.

11

=A10.fetch()

Fetch data from A10’s cursor.