You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "Pastryboy (via GitHub)" <gi...@apache.org> on 2023/02/24 15:55:38 UTC

[GitHub] [superset] Pastryboy opened a new issue, #23193: Chart with a filter on an aggregated calculated column creates incorrect SQL

Pastryboy opened a new issue, #23193:
URL: https://github.com/apache/superset/issues/23193

   #### How to reproduce the bug
   I created a calculated column, Commission, on a chart dataset, used by Time-series by Area chart. Commission = base dataset field NetCommission
   I then put a filter on the chart query for the sum of the calculated column, Commission, to be >0
   
   ### Expected results
   
   ### Actual results
   
   the following message "Error: Flight returned invalid argument error, with message: Column 'CommissionGBP' not found in any table"
   
   In other words the calculated column on the dataset is being sent to the database, where it doesnt exist. Specifically it is happening on the HAVING clause as a result of the filter. The relevant parts of the SQL sent to the database are below;
   
   SQL Query SELECT  ..
          sum(NetCommissionGBP) AS "SUM(CommissionGBP)"
   FROM …
   GROUP BY  …
   **HAVING ((SUm(CommissionGBP)**>0))
   ORDER BY "SUM(CommissionGBP)" DESC
   
   Clearly what should have been generated by the filter is the datasource column, not the calculated dataset column, ie it should be HAVING ((Sum(**Net**CommissionGBP)>0))
   
    
   
   ### Environment
   
   - browser type and version: Chrome Version 110.0.5481.104 (Official Build) (64-bit)
   - superset version: 2.0
    


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Chart with a filter on an aggregated calculated column creates incorrect SQL [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #23193:
URL: https://github.com/apache/superset/issues/23193#issuecomment-1957612453

   This version of Superset is no longer supported. If anyone is still encountering this in current versions (3.x) please open a new Issue or a PR to address the problem.  
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] Chart with a filter on an aggregated calculated column creates incorrect SQL [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed issue #23193: Chart with a filter on an aggregated calculated column creates incorrect SQL
URL: https://github.com/apache/superset/issues/23193


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org