Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-1680

issues with correlation and aggregation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 8.10
    • 7.0
    • Query Engine
    • None
    • Workaround Exists
    • Hide

      Use an inline view the project the aggregate expressions as columns. For example, instead of
      "SELECT (SELECT X FROM Y WHERE Z = MAX(A)) FROM B GROUP BY C"
      use
      "SELECT (SELECT X FROM Y WHERE Z = MAX_A) FROM (SELECT MAX(A) AS MAX_A FROM B GROUP BY C) AS VW"

      Show
      Use an inline view the project the aggregate expressions as columns. For example, instead of "SELECT (SELECT X FROM Y WHERE Z = MAX(A)) FROM B GROUP BY C" use "SELECT (SELECT X FROM Y WHERE Z = MAX_A) FROM (SELECT MAX(A) AS MAX_A FROM B GROUP BY C) AS VW"

    Description

      subqueries used in the having/select clause of a query with grouping only understand correlated element symbols - not correlated grouping expressions or correlated aggregate values.

      If a nested aggregate contains only outer references, then it should be treated as a correlated value.

      Attachments

        Activity

          People

            rhn-engineering-shawkins Steven Hawkins
            rhn-engineering-shawkins Steven Hawkins
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: