astronomy-commons/hats-tap

ADQL left-joins should be translated to equivalent nested when possible

Open

#16 opened on Dec 2, 2025

 (0 comments) (0 reactions) (0 assignees)Python (0 forks)auto 404
enhancementgood first issue

Repository metrics

Stars
 (1 star)
PR merge metrics
 (PR metrics pending)

Description

Feature request

The following ADQL:

SELECT * FROM ppdb.DiaSource ds 
LEFT JOIN ppdb.DiaObject dob ON dob.diaObjectId = ds.diaObjectId
WHERE dob.diaObjectId=24624704620855420

can be done with nothing more than

compute(ppdb.id_search(values={"diaObjectId": 24624704620855420}))

because ppdb already has the joined data nested. While the translation is straightforward, the tricky part is recognizing that it's possible. Nested catalogs served by the TAP server may need to have enough metadata that queries with a LEFT JOIN that accomplish nesting can be simplified as above.

Before submitting Please check the following:

  • I have described the purpose of the suggested change, specifying what I need the enhancement to accomplish, i.e. what problem it solves.
  • I have included any relevant links, screenshots, environment information, and data relevant to implementing the requested feature, as well as pseudocode for how I want to access the new functionality.
  • If I have ideas for how the new feature could be implemented, I have provided explanations and/or pseudocode and/or task lists for the steps.

Contributor guide