Closed gumdropsteve closed 3 years ago
Hi @gumdropsteve!
Try adding WHERE
clause to the query that will exclude today's lines, works for me:
SELECT
DATE_TRUNC('day', TO_TIMESTAMP(DIV(transactions.block_timestamp, 1000*1000*1000))) AS date,
COUNT(*) AS transactions_count_by_date
FROM
transactions
WHERE transactions.block_timestamp < 1626739200000000000
GROUP BY
date
ORDER BY
date;
The data is streamed into the DB in real-time, and some data could be updated. It's not a 100% working solution, but if we stop touching the freshest lines, the query will not use the data that will be probably updated.
Hi @telezhnaya , This worked!
Do you know to get the current date or block_timestamp for the WHERE
so I could avoid having to input it manually?
I thought I had it the other day but can't find the query any more :/
@gumdropsteve you can use subselect and ask for the latest line in transactions
, you have a timestamp there. Then use arithmetics to find 00.00 UTC (subtract the div by number of nanoseconds in a day)
issue
some queries I submit are frequently canceled. other times they work.
error output
Click here to see full error
after that error occurs, i either get
or it runs (rare without reconnecting), or i get the same error, and then get the interface error
code to reproduce the issue
https://gist.github.com/gumdropsteve/96b004c1a4436b481ce68cfd0a285ecc (can be run in colab)