DALQueryError on a LEFT JOIN w/o spatial predicates

:wave: team.

I’ve tried to run this query:

    SELECT COUNT(*) AS orphan_sources
    FROM dp2.DiaSource AS s
    LEFT JOIN dp2.DiaObject AS o ON s.diaObjectId = o.diaObjectId
    WHERE o.diaObjectId IS NULL

(an orphan search), but I get:

DALQueryError: Query Error: Qserv request failed: QID=?: Failed to instantiate query: ParseException:qserv can not parse query, near "LEFT JOIN dp2.DiaObject AS o ON s.diaObjectId = o.diaObjectId"

Per the docs I think this is supported – or am I doing something wrong?

Hi Mario, I’ve found that this query does execute:

SELECT COUNT(*) AS orphan_sources
FROM dp2.DiaSource
LEFT JOIN dp2.DiaObject ON dp2.DiaSource.diaObjectId = dp2.DiaObject.diaObjectId
WHERE dp2.DiaObject.diaObjectId IS NULL

…so it seems the table aliases are tripping up the Qserv parser in this case for some reason. We’ll file a ticket to investigate/fix.

(Result: no orphans, BTW :slight_smile:)