View on GitHub

JODA - JSON On Demand Analysis

Efficient data wrangling for semi-structured JSON documents

SEQNUM - Misc

Returns a sequential number for every document in the collection

Details

Note: due to the multi-threaded nature of JODA, the documents will not necessarily be in order. But it is guaranteed that for N documents every document gets a unique number in [0,N-1] Multiple calls of this function in a single query will return the values independently of each other.

LOAD tmp AS ('/1': SEGNUM()), ('/2': SEGNUM())

may result in [1,43]

Output

Number: a sequential number in [0,#Documents-1]

Usage

SEQNUM()

Examples

Example 1

Input Document

1
-4
5.6
"  -123.3543  "
true
false

Query

LOAD tmp
AS ('': SEQNUM())

Result

0
1
2
3
4
5