Transform only referenced elements in a sub query

Open
#401 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
java
Domain
backend

Research direction

Start by tracing how NeoJoin handles subqueries when transforming elements in the example query, then inspect the related query and view type generation paths. Check how nested subqueries are represented and how selected parent elements reference subquery results. Done means only referenced elements are transformed, including for nested subqueries; the issue names no files or tests, so locate relevant coverage before making changes.

Written by the indexing model from the issue text.

Description

area: language
Problem

Currently, when a subquery is used on a feature of a transformed class, it is treated like a regular query, and all matching elements are transformed. In the example below, not only pizza elements are transformed (referenced by sells from pizzeria elements), but all other food elements are as well. This is usually not intended.

from Restaurant r
where r.type == "Pizzeria"
create {
  r.sells create { name }
}
Proposal

While subqueries could be treated as regular queries for view type generation, we should transform elements with subqueries only if they are referenced by elements selected from the query in which the subquery is defined. Remember that we can have subqueries inside a subquery as well.

Dominant language
Java
Stars
3
Forks
6
Avg merge
19h 10m
Merged PRs (30d)
34

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No 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 vitruv-tools/NeoJoin

All issues in vitruv-tools/NeoJoin

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.