You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/04/21 15:00:21 UTC

[GitHub] [superset] AlexisBRENON opened a new issue #14265: Calculated columns are not expanded when changing to Custom SQL tabs

AlexisBRENON opened a new issue #14265:
URL: https://github.com/apache/superset/issues/14265


   
   ### Expected results
   
   I expect the query to run without errors, because both filters are redundants.
   
   ### Actual results
   
   Query failed with the error:
   ```
   Unknown exception (org.apache.calcite.tools.ValidationException): org.apache.calcite.runtime.CalciteContextException: From line 7, column 9 to line 7, column 17: Column 'calculatedColumn' not found in any table
   ```
   
   #### Screenshots
   
   If applicable, add screenshots to help explain your problem.
   
   #### How to reproduce the bug
   
   From a dataset with calculated columns:
   1. Add a filter through the "SIMPLE" interface on a calculated column
   2. Switch to "CUSTOM SQL" interface and copy the generated code
   3. Save this filter
   4. Add another filter by pasting the copied copy during step 2 in the "CUSTOM SQL" interface
   5. Run the query
   
   ### Environment
   
   - superset version: 1.0.1
   
   ### Additional context
   
   The generated query look like this:
   
   ```
   SELECT FLOOR("__time" TO MONTH) AS "__timestamp",
   FROM "druid"."dataset"
   WHERE "__time" >= '2021-04-01 00:00:00.000000'
     AND "__time" <= '2021-04-30 23:59:59.000000'
     AND LOOKUP(id, 'name') = 'foo'
     AND ((calculatedColumn = 'foo'))
   GROUP BY FLOOR("__time" TO MONTH)
   LIMIT 50000;
   ```
   
   Where `calculatedColumn` is defined as `LOOKUP(id, 'name')`.


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



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