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 2020/05/31 09:21:08 UTC

[GitHub] [incubator-superset] Matt-Texier opened a new issue #9955: Time range and SQL query generation issue / Exclusive issue

Matt-Texier opened a new issue #9955:
URL: https://github.com/apache/incubator-superset/issues/9955


   Hi,
   
   When using custom time range and entering two dates within the same day, the query generated always gives an empty result as it generates a query with >= start_day and < star_day. As the second term is strict (exclusive) and that data is indexed on a per day basis, it excludes all data to be selected.
   
   ### Expected results
   
   I would expect to see data matching the date time beginning and end.
   
   ### Actual results
   
   The query generated exclude all data.
   
   #### Screenshots
   
   <img width="289" alt="Screenshot 2020-05-31 at 11 08 55" src="https://user-images.githubusercontent.com/11010314/83348729-63b7c600-a32f-11ea-9007-fc0054e021db.png">
   
   
   generate query:
   
   ```sql
   SELECT ip_proto AS ip_proto,
          rtr_name AS rtr_name,
          port_dst AS port_dst,
          if_out_name AS if_out_name,
          port_src AS port_src,
          toStartOfMinute(toDateTime(full_time_stamp)) AS __timestamp,
          sum(packets)/any(bin_cycle_sec) AS pps
   FROM enriched_flows
   WHERE index_tstamp >= toDate('2020-05-30')
     AND index_tstamp < toDate('2020-05-30')
     AND full_time_stamp >= toDateTime('2020-05-30 22:00:00')
     AND full_time_stamp < toDateTime('2020-05-30 23:00:00')
     AND ipv4_dst = '134.90.137.11'
   GROUP BY ip_proto,
            rtr_name,
            port_dst,
            if_out_name,
            port_src,
            toStartOfMinute(toDateTime(full_time_stamp))
   ORDER BY pps DESC
   LIMIT 50000;
   <img width="289" alt="Screenshot 2020-05-31 at 11 08 55" src="https://user-images.githubusercontent.com/11010314/83348718-4682f780-a32f-11ea-961d-daa531ba70d4.png">
   
   ```
   
   #### How to reproduce the bug
   
   1. Create a chart with customer time range, pick to date / time within he same day but with few hours difference
   2. Run the query
   3. On te to right burger icon, click view query
   4. You will see that superset include the time index as start but exclude the same time index of the current day (my db is using time index of day granularity and time stamp bin cycle of minute) 
   
   ### Environment
   
   (please complete the following information):
   
   - superset version: `0.36.0`
   - python version: `3.6.9`
   - node.js version: `v8.15.0`
   - npm version: `6.4.1`
   
   ### Checklist
   
   Make sure these boxes are checked before submitting your issue - thank you!
   
   - [x ] I have checked the superset logs for python stacktraces and included it here as text if there are any.
   - [x ] I have reproduced the issue with at least the latest released version of superset.
   - [x ] I have checked the issue tracker for the same issue and I haven't found one similar.
   
   ### Additional context
   
   I don't know how the inclusive / exclusive logic has been designed, it could be that there is a corner case when user picks two dates time within the same day ... or missed something on how to use it... 
   
   Thanks for your help,
   Matt.
   


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


[GitHub] [incubator-superset] pengyejun commented on issue #9955: Time range and SQL query generation issue / Exclusive issue

Posted by GitBox <gi...@apache.org>.
pengyejun commented on issue #9955:
URL: https://github.com/apache/incubator-superset/issues/9955#issuecomment-636489584


   @Matt-Texier  Hi, Please take a screenshot of the left configuration panel.


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


[GitHub] [incubator-superset] Matt-Texier commented on issue #9955: Time range and SQL query generation issue / Exclusive issue

Posted by GitBox <gi...@apache.org>.
Matt-Texier commented on issue #9955:
URL: https://github.com/apache/incubator-superset/issues/9955#issuecomment-643311795


   Closing this issue : I found a workaround by removing the index timestamp from the table. It avoids superset to get in troubles with two time related fields in the same query ... 


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


[GitHub] [incubator-superset] Matt-Texier commented on issue #9955: Time range and SQL query generation issue / Exclusive issue

Posted by GitBox <gi...@apache.org>.
Matt-Texier commented on issue #9955:
URL: https://github.com/apache/incubator-superset/issues/9955#issuecomment-636496168


   @pengyejun Sure, here you go ...
   
   <img width="493" alt="Screenshot 2020-05-31 at 18 41 44" src="https://user-images.githubusercontent.com/11010314/83357754-9c2ac480-a36e-11ea-888c-5dbe9a7305e4.png">
   


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


[GitHub] [incubator-superset] Matt-Texier commented on issue #9955: Time range and SQL query generation issue / Exclusive issue

Posted by GitBox <gi...@apache.org>.
Matt-Texier commented on issue #9955:
URL: https://github.com/apache/incubator-superset/issues/9955#issuecomment-641855702


   Hi Guys,
   
   Have you been able to have a look to this issue ... It could be specific to my backend and SQLAlchemy driver ?
   
   I do suffer from it as a significant regression ... I could be alone suffering from it ?
   
   Thanks Matt.


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


[GitHub] [incubator-superset] Matt-Texier closed issue #9955: Time range and SQL query generation issue / Exclusive issue

Posted by GitBox <gi...@apache.org>.
Matt-Texier closed issue #9955:
URL: https://github.com/apache/incubator-superset/issues/9955


   


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