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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to