T.groupn(x;F)

Description:

Define a computation on a pseudo table, which will group its records and write the grouped subsets to a sequence of bin files.

Syntax:

T.groupn(x;F)

Note:

The function defines a computation on pseudo table T, which will group its records by grouping expression x and write the grouped subsets to a sequence of bin files F, and return a new pseudo table.

Parameter:

T

A pseudo table

x

Grouping expression

F

A sequence of bin file objects

Return value:

Pseudo table

Example:

 

A

 

1

=create(file).record(["empAll.ctx"])

 

2

=pseudo(A1)

Generate a pseudo table from the composite table.

3

=[file("f_dept.btx"),file("m_dept.btx")]

Return a sequence of bin file objects

4

=A2.groupn(if(GENDER=="F",1,2);A3)

Define a computation on A2’s pseudo table, which will put records where GENDER is F into the first group and the other records into the second group and write the grouped subsets into a sequence of bin files correspondingly.

5

=A4.cursor().fetch()

Fetch data from A4’s pseudo table, when the grouped subsets are actually written to bin files.