Motivation
Follow-up to #3879 (vector.neighbors options map) and #3880 (fulltext.* options map). The four SQL graph path-finding functions have inconsistent option handling:
shortestPath(src, dest [, direction [, edgeType [, {maxDepth, edge}]]]) - mixed positional + map, map only covers two knobs.
dijkstra(src, dest, weight [, direction]) - single positional, primed for growth (edgeTypeNames, maxDepth, etc.).
bellmanFord(src, dest, weight [, direction]) - same as dijkstra, plus a foreseeable detectNegativeCycles flag.
astar(src, dest, weight [, {options}]) - already fully map-driven, but uses hand-rolled parsing that silently ignores unknown keys.
Proposal
- Route all four through
com.arcadedb.function.sql.FunctionOptions so unknown keys throw a descriptive error and type coercion is consistent with vector.neighbors and fulltext.*.
- Let
shortestPath, dijkstra, bellmanFord accept an options map that consolidates direction, edgeTypeNames, maxDepth, emptyIfMaxDepth, and (for shortestPath) edge. Existing positional forms stay for backward compatibility.
astar keeps the same surface but swaps its bespoke parser for FunctionOptions, keeping the same accepted keys (direction, edgeTypeNames, vertexAxisNames, parallel, maxDepth, emptyIfMaxDepth, tieBreaker, dFactor, heuristicFormula, customHeuristicFormula).
Non-goals
- No grammar changes.
- No renames: these functions already use camelCase under the convention.
Deliverables
- Code: refactor the four functions through
FunctionOptions.
- Tests: options-map form + unknown-key rejection.
- Docs: show options-map syntax alongside positional for each function.
Motivation
Follow-up to #3879 (
vector.neighborsoptions map) and #3880 (fulltext.*options map). The four SQL graph path-finding functions have inconsistent option handling:shortestPath(src, dest [, direction [, edgeType [, {maxDepth, edge}]]])- mixed positional + map, map only covers two knobs.dijkstra(src, dest, weight [, direction])- single positional, primed for growth (edgeTypeNames, maxDepth, etc.).bellmanFord(src, dest, weight [, direction])- same as dijkstra, plus a foreseeabledetectNegativeCyclesflag.astar(src, dest, weight [, {options}])- already fully map-driven, but uses hand-rolled parsing that silently ignores unknown keys.Proposal
com.arcadedb.function.sql.FunctionOptionsso unknown keys throw a descriptive error and type coercion is consistent withvector.neighborsandfulltext.*.shortestPath,dijkstra,bellmanFordaccept an options map that consolidatesdirection,edgeTypeNames,maxDepth,emptyIfMaxDepth, and (for shortestPath)edge. Existing positional forms stay for backward compatibility.astarkeeps the same surface but swaps its bespoke parser forFunctionOptions, keeping the same accepted keys (direction,edgeTypeNames,vertexAxisNames,parallel,maxDepth,emptyIfMaxDepth,tieBreaker,dFactor,heuristicFormula,customHeuristicFormula).Non-goals
Deliverables
FunctionOptions.