alamb commented on issue #4809:
URL: 
https://github.com/apache/arrow-datafusion/issues/4809#issuecomment-1372182416

   > Support time range of one query is [2022-12-02, 2022-12-04], and the real 
dataset is
   
   > 2022-12-01, 10
   > 2022-12-03, 20
   > 2022-12-04, 30
   
   > Then what is the result of locf(avg(c0) for 2022-12-02, None or 10?
   
   I am not sure
   
   
   > I don't know how timescale deal with this case, IMO rewrite time query of 
one query may not suitable for datafusion since it's a generic SQL engine.
   
   It may well be the case that this is something that is not easy / reasonable 
to express in SQL (
   
   > Any ideas about this first value issue?
   
   The `timebucket_gap_fill` function 
([docs](https://docs.timescale.com/api/latest/hyperfunctions/gapfilling-interpolation/time_bucket_gapfill/))
  can take an optional `start` and `finish` arguments which perhaps offers a 
way to express this case (apply start/finish filters after the query?)
   
   Another way I could imagine is to run a subquery that has the full range 
`[2022-12-01, 2022-12-04]` with `timebucket_gap_fill` and then apply a filter 
in an outer query to restrict the data to `[2022-12-02, 2022-12-04]`
   


-- 
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: github-unsubscr...@arrow.apache.org

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

Reply via email to