You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2019/12/12 19:29:51 UTC

[GitHub] [incubator-druid] cheezman34 opened a new issue #9018: HAVING in sql semijoins cannot see aggregated field

cheezman34 opened a new issue #9018: HAVING in sql semijoins cannot see aggregated field
URL: https://github.com/apache/incubator-druid/issues/9018
 
 
   ### Affected Version
   
   0.16.1 (and prior versions)
   
   ### Description
   
   Example SQL:
   
   ```
   SELECT "field1"
   FROM table1
   WHERE "field2" IN
       (SELECT "field3"
        FROM
          (SELECT SUM("value") as "abc",
                  "field3"
           FROM table2
           GROUP BY "field3"
           HAVING "abc" > 100))
   ```
   
   Any query of this form will invariably see an exception that looks something like:
   `org.apache.calcite.tools.ValidationException: org.apache.calcite.runtime.CalciteContextException: From line 1, column 400 to line 1, column 404: Column 'abc' not found in any table`
   
   I've no idea if this is a bug, oversight, or unimplemented feature, but it would be great if queries like this worked.  For the record, the HAVING clause appears to work with ordinary table columns, just not ones that are aggregated at query time.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org