Result Modes: ONE ROW PER MATCH and ONE ROW PER STEP

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

GRAPH_TABLE can return a path in two shapes.

  • ONE ROW PER MATCH (the default): one row for the whole path.
  • ONE ROW PER STEP: one row for each hop along the path.

Result modes matter most when a path can be more than one hop.

1GRAPH_TABLE ( <graph>
2    MATCH <pattern> [WHERE <condition>]
3    [ ONE ROW PER MATCH
4    | ONE ROW PER STEP ( <src_var>, <edge_var>, <dst_var> ) ]
5    COLUMNS ( <column>[, ...] )
6)

Put the result-mode clause after MATCH and before COLUMNS.

Use these with the commerce graph from Defining a Property Graph.

One Row for the Whole Path 

Use ONE ROW PER MATCH when you want one answer per walk, such as one row for each product Avery can reach.

1WITH pg AS PROPERTY GRAPH (...)
2SELECT * FROM GRAPH_TABLE(pg
3    MATCH (i:individual)-[]-{2,4}(product:product)
4    ONE ROW PER MATCH
5    COLUMNS (
6        i.name AS individual_name,
7        product.name AS product_name
8    )
9) AS gt;

The pattern omits the edge label so customerOrder and orderProduct can both match. One row per walk, no matter how many hops. Avery → Order 100 → Trail Shoes is the two-hop case.

One Row for Each Hop 

Use ONE ROW PER STEP when you want to see each connection in the walk. A two-hop path returns two rows.

Name each iterator in the parentheses, in written order: the starting vertex, the edge, and the ending vertex.

PositionRoleBinds to
1stFromThe vertex written before the edge
2ndEdgeThe connection for that hop
3rdToThe vertex written after the edge

Read those names in COLUMNS the same way you read i.name. Don’t use them in WHERE. A WHERE filters the whole path, not one hop.

The names follow the written pattern, not the physical source and destination of the edge table. For a left-pointing edge (<-), the first name is still the vertex you wrote first.

1WITH pg AS PROPERTY GRAPH (...)
2SELECT source_name, created_date, quantity, destination_name
3FROM GRAPH_TABLE(pg
4    MATCH (i:individual)-[]-{2,4}(product:product)
5    ONE ROW PER STEP (from_el, relationship, to_el)
6    COLUMNS (
7        from_el.name AS source_name,
8        relationship.createdDate AS created_date,
9        relationship.quantity,
10        to_el.name AS destination_name
11    )
12) AS gt;

The pattern omits the edge label so customerOrder and orderProduct can both match. If Avery’s Order 100 contains two pairs of Trail Shoes, the two-hop path is Avery -> Order 100 -> Trail Shoes and produces two rows. The customer-to-order hop has no quantity, so that value is NULL on the first row.

source_namecreated_datequantitydestination_name
Avery2026-08-01NULLOrder 100
Order 1002026-08-012Trail Shoes

Rows follow the written walk (Avery → Order 100, then Order 100 → Trail Shoes), not the edge table’s SOURCE/DESTINATION.

Rules 

  • The three step variables must be new and distinct. Don’t reuse i, order, or product.
  • ONE ROW PER STEP allows only one path pattern in MATCH.
  • On a pattern with no edges, only the first variable binds. Referencing the edge or destination variable is an error.
  • A variable bound to one vertex stays the same on every step of that match. A variable on a repeated edge isn’t available in COLUMNS.

Related Documentation