- 8.0.3
- sql:
SELECT facility, name, start_ts, end_ts
FROM heats
WHERE start_ts BETWEEN '2024-07-19 04:13:00' AND '2024-07-19 05:00:00' AND name IN ('VIGB-19Jul24@00_13_00', 'CNSRC-19Jul24@00_40_00', 'BAYB-18Jul24@23_59_20')
), s AS (
SELECT
facility,
tower_symbols,
ts, sm.flow_to_customer,
flow_from_customer_scfm,
good_gas_sp_scfm,
good_gas_contract_scfm,
good_gas_internal_scfm,
process_flow_from_customer_scfm,
recovered_from_customer_process_scfm
FROM sm
WHERE ts BETWEEN '2024-07-19 04:13:00' AND '2024-07-19 05:00:00' AND tower_symbols IS NOT NULL
)
SELECT
h.name,
h.facility,
MIN(s.ts) AS start_ts,
MAX(s.ts) AS end_ts,
ROUND(SUM(s.flow_to_customer)) AS flow_to_customer,
ROUND(SUM(s.flow_from_customer_scfm)) AS flow_from_customer_scfm,
ROUND(SUM(s.good_gas_sp_scfm)) AS good_gas_sp_scfm,
ROUND(SUM(s.good_gas_contract_scfm)) AS good_gas_contract_scfm,
ROUND(SUM(s.good_gas_internal_scfm)) AS good_gas_internal_scfm,
ROUND(SUM(s.process_flow_from_customer_scfm)) AS process_flow_from_customer_scfm,
ROUND(SUM(s.recovered_from_customer_process_scfm)) AS recovered_from_customer_process_scfm
FROM s INNER JOIN h ON s.facility = h.facility AND s.ts BETWEEN h.start_ts AND h.end_ts
GROUP BY 1,2
ORDER BY 3 DESC;```
explain:
“QUERY PLAN”
“Sort light”
" keys: [start_ts desc]"
" VirtualRecord"
" functions: [name,facility,start_ts,end_ts,round(SUM),round(SUM1),round(SUM2),round(SUM3),round(SUM4),round(SUM5),round(SUM6)]"
" GroupBy vectorized: false"
" keys: [name,facility]"
" values: [min(ts),max(ts),sum(flow_to_customer),sum(flow_from_customer_scfm),sum(good_gas_sp_scfm),sum(good_gas_contract_scfm),sum(good_gas_internal_scfm),sum(process_flow_from_customer_scfm),sum(recovered_from_customer_process_scfm)]"
" SelectedRecord"
" Filter filter: s.ts between h.start_ts and h.end_ts"
" Hash Join Light"
" condition: h.facility=s.facility"
" SelectedRecord"
" Async Filter workers: 8"
" filter: tower_symbols is not null"
" DataFrame"
" Row forward scan"
" Interval forward scan on: sm"
" intervals: [("2024-07-19T04:13:00.000000Z","2024-07-19T05:00:00.000000Z")]"
" Hash"
" Async Filter workers: 8"
" filter: name in [VIGB-19Jul24@00_13_00,CNSRC-19Jul24@00_40_00,BAYB-18Jul24@23_59_20]"
" DataFrame"
" Row forward scan"
" Interval forward scan on: heats"
" intervals: [("2024-07-19T04:13:00.000000Z","2024-07-19T05:00:00.000000Z")]"
3. Stack trace is very strange:
```2024-07-19T05:04:01.879098Z E i.q.c.h.HttpConnectionContext internal error [fd=130, e=`
java.lang.OutOfMemoryError: Java heap space
`]```
It takes time to rise this issue. Query itself works. After ~12h it rises the exception. I was trying to use java21 and java17. Still no luck in addressing it (except restart in cron)