Uploaded image for project: 'Teiid Designer'
  1. Teiid Designer
  2. TEIIDDES-2382

No error message for query with aggregate function and no group by clause

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 8.6
    • Transformations
    • None
    • Hide

      1. Create a table and in the transformation editor write following select query (missing group by clause):
      SELECT cust.id AS customer_id, SUM(ord.amount) AS total_amount
      FROM
      customers AS cust INNER JOIN orders AS ord
      ON cust.id = ord.customer_id;
      2. Save the editor content

      Show
      1. Create a table and in the transformation editor write following select query (missing group by clause): SELECT cust.id AS customer_id, SUM(ord.amount) AS total_amount FROM customers AS cust INNER JOIN orders AS ord ON cust.id = ord.customer_id; 2. Save the editor content

      In designer when defining a table in view model with following transformation query, bad error message is returned to user.

      SELECT cust.id AS customer_id, SUM(ord.amount) AS total_amount
      FROM
      customers AS cust INNER JOIN orders AS ord
      ON cust.id = ord.customer_id
      GROUP BY cust.id;

      When user forgets to write the GROUP BY clause then error with following message occurs: "ERROR:ERROR".
      When I execute similar query via teeid driver then I get very useful message: "Error: Remote org.teiid.api.exception.query.QueryValidatorException: Non-constant, non-aggregate expression cust.id cannot be mixed with aggregate functions and implicit grouping."
      It would be very helpful if Teiid designer gave similar message instead of the "ERROR:ERROR" one.

            blafond Barry LaFond
            jstastny@redhat.com Jan Stastny
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: