Solved

DirectQuery For Future Datapoints

  • 24 August 2022
  • 2 replies
  • 39 views

Userlevel 3

Hello!

I am querying for DataPoints using the PostgreSQL Gateway, which I assume will have the same behavior as the DirectQuery feature built on the PostgreSQL Gateway.  What I am noticing is that I am not able to retrieve any DataPoints for future dates.  Is this intended or a bug?  Most of the data we produce and manage is in the future, so this would be an important feature for us if it could be supported.  Thanks!

 

Query results returned in Azure Data Studio from PostgreSQL gateway:

In CDF these time series have datapoints representing predictions far out into the future:

 

icon

Best answer by Einar Omang 24 August 2022, 08:34

View original

2 replies

Userlevel 2

I think this is because querying for datapoints defaults to fetching everything before current time. You can specify a max time, and it will use that instead. To translate that to the postgres gateway, try adding a condition on max time, like `time_stamp < ‘2030-01-01T00:00:00`.

Userlevel 3

Wow! It works!  You’re my hero, @Einar Omang !

All we need to do is include a upper and lower bound for time_stamp in the query.  Thanks!

 

Reply