spmallette opened a new pull request, #3577:
URL: https://github.com/apache/tinkerpop/pull/3577
The reference documentation for the `product()`-step described the
cartesian-product semantics and the array/Iterable input expectation, but did
not state the shape of the result.
This adds that clarification to the Product Step section of
`the-traversal.asciidoc`:
- The result is a `List` in which each element is itself a two-element
`List`, one for each combination of an item from the incoming list with an item
from the argument list.
- Element order and duplicates are preserved (the result is a list of all
combinations, not a de-duplicated set).
- A `Map` argument is not accepted and throws an `IllegalArgumentException`,
since a `Map` is neither an array nor an `Iterable`.
This mirrors the return-type clarification style used elsewhere for the
set-oriented steps, adapted to `product()`'s list-of-pairs semantics. The
change is scoped to the Product Step section only.
Verified against the modern toy graph:
`g.V().values("name").fold().product(["james","jen"])` yields the twelve
two-element lists `[[marko, james], [marko, jen], ..., [peter, jen]]`, and
passing a `Map` throws `IllegalArgumentException` ("product step can only take
an array or an Iterable as an argument").
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]