Good evening, I have version 29.0.0 and I have 3 q...
# general
g
Good evening, I have version 29.0.0 and I have 3 questions: 1. can i upload data to druid via postgress? 2. i enabled windows functions in context but while run a query, it doesn't return results. does it need any extra configuration? 3. If I use reindex and create a rollup from an existing datasource, is it possible that when I update the original datasource, it automatically triggers and updates the rollup as well? Thank you.
s
1. Yes. Check out @Kyle Hoondert’s blog on the subject, just replace mysql for postgres which are both supported in Druid. 2. Can you share your Window function SQL so we can troubleshoot? 3. There are no automatic triggers for updates to the rollup (yet). Some implementations ingest the rollup at the same time they do the raw data with different ingestion jobs.
g
Thank you for your answer! 1. i will try!! 2. something like this SELECT id, rank() over w as rnk, LEAD(loan_id) over w lead_loan, LAG(loan_id) over w lag_loan, principal_amount FROM "druid"."test" where month_str = '2023-11' WINDOW w AS (PARTITION BY id ORDER BY __time ASC) 3. ok!
s
Window functions are still experimental. I have seen some issues with the WINDOW syntax. Try to specify the window on each of the windowed functions?
Also, I just remembered, that in the current instantiation, you must use an aggregation query, so something like:
Copy code
SELECT id,
 rank() over w as rnk,
 LEAD(loan_id) over w lead_loan,
 LAG(loan_id) over w lag_loan,
 SUM(principal_amount) as principal_amount
 FROM "druid"."test"
 where month_str = '2023-11'
GROUP BY id
 WINDOW w AS (PARTITION BY id ORDER BY __time ASC)