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

Qserv query analyzer incorrectly handles fully qualified duplicate column names in queries

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: To Do
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: Qserv
    • Labels:
      None

      Description

      When processing queries joining results from two or many tables Qserv query analyzer is unable to handle queries involving similarly named columns mentioned in the SELECT list. For example, the following query:

      SELECT o.objectId, s.objectId FROM Object o, Source s LIMIT 1
      

      fails with the following error:

      ERROR 4110 (Proxy) at line 1: Query processing error: QI=?: Failed to instantiate query:
       AnalysisError:Duplicate names detected in select expression,
       rewrite SQL query using alias: [1] 'objectid' at positions: 1 2
      

      Exactly the same problem is seen w/o using table aliases like in this query:

      SELECT Object.objectId, Source.objectId FROM Object, Source LIMIT 1
      

      A workaround in giving aliases to each column in the SELECT list makes the analyzer happy (though, the query fails for different reasons not to be mentioned in this context):

      SELECT o.objectId AS o_objectId, s.objectId AS s_objectId FROM Object o, Source s LIMIT 1
      

        Attachments

          Activity

          There are no comments yet on this issue.

            People

            Assignee:
            npease Nate Pease
            Reporter:
            gapon Igor Gaponenko
            Watchers:
            Fritz Mueller, Igor Gaponenko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: