Change Password

Input error
Input error
Input error
Submit

Change Nickname

Current Nickname:
Submit
Search
v4.0
    v4.0

    UNCOLLECT | Expand

    Format, Parameters

    UNCOLLECT can expand each row in the data stream into multiple rows. The input column (ARRAY type) of UNCOLLECT releases each element of its arrays into an independent row, and the homologous columns of the input column copy their respective rows in order to fill up the column length while keeping the intra-row correlations. The expanded column has a length that equals the sum of lengths of all the arrays in the input column.

    Syntax:

    • Format: uncollect <column> as <alias>
    • Parameters: see table below
    • Affected columns: <column> and all its homologous columns
    Name Category Specification Description
    <column> NODE,EDGE,PATH,ATTR,ARRAY,TABLE / The array columns to be uncollected
    <alias> string With the same naming convention as custom alias The alias after uncollection of array columns, non-omittable

    Analysis

    n(2).e()[:3].n(4) as path
    with pnodes(path) as a1
    uncollect a1 as a2
    return path, a2
    

    In the UQL statement above, UNCOLLECT expands an ARRAY column into 6 rows and duplicates its homologous columns into 6 rows:

    Common Usage

    Example: find paths from Card CA001 to CA003 within 3 steps, deduplicate the nodes on the paths and return

    ab().src({_id == "CA001"}).dest({_id == "CA003"}).depth(:3) as p 
    with pnodes(p) as a
    uncollect a as n
    return distinct(n)
    
    Please complete the following information to download this book
    *
    公司名称不能为空
    *
    公司邮箱必须填写
    *
    你的名字必须填写
    *
    你的电话必须填写
    *
    你的电话必须填写