I'm still trying to crossmatch CatWISE2020 with VHS DR5. I have aborted my recent query because it neither times out nor it succeeds.
That's why I started with a new approach and tried to replicate the crossmatch query from one of the notebooks labeled "How to do an efficient crossmatch of a user table with a table in Data Lab" (notebooks-latest/04_HowTos/CrossmatchTables/).
My current query reads as follows:
query = '''SELECT c.*, vv.japermag3, vv.mergedclass
FROM mydb://catwxvhs AS c
INNER JOIN LATERAL (
SELECT v.ra2000, v.dec2000, v.japermag3, v.mergedclass
vhs_dr5.vhs_cat_v3 AS v
q3c_join(c.ra, c.dec, v.ra2000, v.dec2000, 0.0014)
q3c_dist(c.ra, c.dec, v.ra2000, v.dec2000)
ASC LIMIT 1
) as vv ON true'''
Even though it's nearly the same query from the notebook, it unfortunately results in an error message and I've got no clue why that is. The error message says:
Error: IllegalArgumentException: net.sf.jsqlparser.JSQLParserException JSQLParserException: ParseException: Encountered "vv" at line 1, column 12.
Was expecting one of:
What have I done wrong? Why does the "vv" seem to be the problem? The original query uses "gg" for the outer part and "g" in the inner part. I just switched that to "vv" and "v".