astronomy-commons/hats-tap

Handle ADQL COUNT(DISTINCT) as a request for unique values

Aperta

#19 aperta il 2 dic 2025

 (1 commento) (0 reazioni) (0 assegnatari)Python (0 fork)auto 404
enhancementgood first issue

Metriche repository

Star
 (1 stella)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

Feature request

The following AQDL:

SELECT COUNT(DISTINCT diaObjectId) FROM ppdb.DiaObject

can be translated to:

import numpy as np
# This is just loading data from the diaObjectId column.
np.unique(compute(ppdb["diaObjectId"]))

# It may also be possible to do it via Dask:
compute(ppdb["diaObjectId"].unique())

There is quite a lot to translate here, since the COUNT and DISTINCT are not being done as part of compute, but outside of it. Despite the long reach, however, the concept here is a common one, and detecting that the user is asking for it and turning it into the most efficient LSDB version is still worth doing.

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.

Guida contributor