ADQL: Obtaining SN Host Galaxy Information

I am trying to collect table data on SN host galaxies within a DP0.2 notebook with a basic ADQL query. I have narrowed down my issue to just the following few lines:
test_query = (
'FROM dp02_dc2_catalogs.Object as obj ’
'JOIN dp02_dc2_catalogs.TruthSummary as ts ’
'ON obj.objectId = ts.host_galaxy ’
test_results =

producing the error:
Query processing error: QI=?: Failed to instantiate query: AnalysisError:Query involves partitioned table joins that Qserv does not know how to evaluate using only partition-local data

Please can anyone advise? Thanks in advance.

1 Like

Hi Dan, thanks for posting this question.

I can immediately see a few drawbacks of how the query is written. It’s selecting data from all 990 columns from the Object table, and has no spatial constraints so this is operating across the entire catalog. Additionally the Object and TruthSummary tables cannot be joined using the host_galaxy column. Although the definition for the host_galaxy column is “ID of the host galaxy”, that’s a different identifier (from the simulation) than objectId (which is from the source detection pipelines). And I suspect that’s why you’re getting the error about partitioned table joins. The Object table can be joined with the MatchesTruth table, not TruthSummary.

That said, I’m working to reproduce the error and to provide you with an example of a query that will work better for you. Standby I should have that ready today.

Hi again Dan,

I prepared a notebook titled “dia_truth_host_sample.ipynb” and added it to the delegate-contributions-dp02 repository, in the “dia_explorations” folder. This notebook provides a demo of how to get data for a subset of simulated DC2 galaxies which were designated as hosts for simulated SNe, and to find out if these galaxies were detected in a deepCoadd image and are in the Object table.

I’m going to mark my previous reply as the “solution” for this topic, as the main issue was the reason for the error message, which was caused by the inability to join Object and TruthSummary(but they can both be joined to MatchesTruth).

If you have any follow-up comments on this error message or the solution, please feel free to post here. And as always, feel free to open a new topic at any time with new questions.

1 Like

Hi Melissa,
Thank you! The notebook is extremely helpful - and I appreciate you helping identify the shortcomings in my very basic query.

1 Like