SQL / InfluxQL time zone settings

Hello everyone,
my first post here :slight_smile:
Trying to figure out the things I can do with the Iox engine, and the very first thing that I think I’m missing is how to set up the session time zone for a query.
For example, I’d like to select data (with SQL) with a windowed function, let’s say with a 1 day window.
Or again, I write a simple select, including the timestamp in the select list, and a where clause on the timestamp as well.
I’d like them to automatically work with a desired timezone (and return the timestamps in that timezone as well), so that I don’t need to make awkward calculations with the UTC offset and the DST adjustment.
Is that possible? For example, in Postgres I would write something like “SET SESSION TIME ZONE ‘Europe/Berlin’”, or in Flux, a command like “option location = timezone.location(name: “Europe/Rome”)” was available.
Thank you!

Hello @Torakiki73,
Welcome! Thanks for giving 3.x a shot!
Unfortunately I don’t think there is that functionality. We use the datafusion SQL implementation under the hood and I don’t see that existing there in the reference:
https://arrow.apache.org/datafusion/user-guide/sql/index.html

I recommend just using to SQL to query your data and then transforming it with the python client library which supports pandas and polars.

Hello Anais,
thanks a lot for your answer!
Retrieving all the data points from Influx, and then transforming them with Python or something, is surely a viable option, even though I was hoping for something built-in :slight_smile:
I have some concerns over the performances when big time spans are involved, covering maybe tens of thousands datapoints, but that’s something I’ll have to test.
Thanks again for your time!

Regards,
Alberto