mabel-dev / opteryx

🦖 A SQL-on-everything Query Engine you can execute over multiple databases and file formats. Query your data, where it lives.
https://opteryx.dev
Apache License 2.0
49 stars 10 forks source link

✨ [ClickBench] Timestamp functions on Unix Epoch timestamps #1702

Open joocer opened 1 month ago

joocer commented 1 month ago

Functions which work on dates and timestamps generally don't work on Linux Epoch timestamps

extract(minute FROM EventTime)

┌────┬────────────┐
│    │ EventTime  │
│    │  INTEGER   │
╞════╪════════════╡
│  1 │ 1373834327 │
│  2 │ 1373913230 │
│  3 │ 1373914595 │
│  4 │ 1373914712 │
│  5 │ 1373833834 │
│  6 │ 1373841641 │
│  7 │ 1373916373 │
│  8 │ 1373917016 │
│  9 │ 1373912311 │
│ 10 │ 1373851126 │
└────┴────────────┘
joocer commented 1 month ago

and

SELECT URL, COUNT(*) AS PageViews FROM hits WHERE CounterID = 62 AND EventDate >= '2013-07-01' AND EventDate <= '2013-07-31' AND DontCountHits = 0 AND IsRefresh = 0 AND URL <> '' GROUP BY URL ORDER BY PageViews DESC LIMIT 10;