Inline sorting of traversal result in SELECT projection

Open
#9,564 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
java, sql
Domain
databases

Research direction

Start by reviewing OrientDB's SELECT projection and traversal-function handling, using the nested out() examples as the behavioral target. Determine how inline single- and multi-key sorting should be specified and validated, then add coverage showing ordered nested traversal results; done means the illustrated queries produce the requested ordering.

Written by the indexing model from the issue text.

Description

OrientDB Version: 3.1.8 (docker)

I don't think this exists yet, so this is probably a feature request.

It would be great to have a way to sort the partial result set returned by a traverse function (e.g. out()). This would make it a lot easier to control the order of nested traversal projections.

Example

SELECT
  /* as method, string argument -> single sort */
  out("hasContainer").sort("id:asc"):{
    id,
    size,
    /* as method, array argument -> multiple sort */
    out("hasContent").sort(["promisedDeliveryDate:desc", "id:asc"]):{
      id,
      dispatchDate,
      promisedDeliveryDate,
      /* Maybe as a function? I think it is a less readable syntax. */
      sort(out("hasLineItems"), "lineId:asc"):{
        lineId,
        name,
        quantity
      } AS lineItems
    } AS contents
  } AS containers
FROM Manifest;
Dominant language
Java
Stars
5k
Forks
868
Avg merge
15h 6m
Merged PRs (30d)
18

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from orientechnologies/orientdb

All issues in orientechnologies/orientdb

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.