Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-38954

Query generation logic bug in spatial query with HTM constraint

    XMLWordPrintable

    Details

      Description

      While poking around to try to come up with some test data for DM-38592, I attempted this query:

      butler.registry.queryDataIds(
          ["tract", "patch", "visit", "detector", "htm7"],
          skymap="hsc_rings_v1",
          instrument="HSC",
          where="htm7 IN (htm_ids)",
          bind={"htm_ids": [231828, 231829]},
      ).expanded()
      

      and got this:

      ProgrammingError: (psycopg2.errors.DuplicateAlias) table name "patch_skypix_overlap" specified more than once
      

        Attachments

          Activity

          Hide
          jbosch Jim Bosch added a comment -

          Andy Salnikov, here's one more small review request, for SQL-generation bugfix in the query system:

          https://github.com/lsst/daf_butler/pull/834

          It's basically a guard against joining in the same subquery multiple times.

          Show
          jbosch Jim Bosch added a comment - Andy Salnikov , here's one more small review request, for SQL-generation bugfix in the query system: https://github.com/lsst/daf_butler/pull/834 It's basically a guard against joining in the same subquery multiple times.
          Hide
          salnikov Andy Salnikov added a comment -

          Looks good.

          Show
          salnikov Andy Salnikov added a comment - Looks good.

            People

            Assignee:
            jbosch Jim Bosch
            Reporter:
            jbosch Jim Bosch
            Reviewers:
            Andy Salnikov
            Watchers:
            Andy Salnikov, Jim Bosch
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Jenkins

                No builds found.