questdb/questdb

Add support FILL by PREV

オープン

#2,761 opened on 2022/11/11

 (1 件のコメント) (1 件のリアクション) (0 人の担当者)Java (972 件のフォーク)batch import
Help wantedNew featureSQL

Repository metrics

Stars
 (13,403 個のスター)
PR merge metrics
 (平均マージ 5d 13h) (30d で 108 merged PRs)

説明

Is your feature request related to a problem?

yes

Describe the solution you'd like.

I think for optimize sql query like kline or candle query we should have something like continuous query in influxdb 1.8

Reason why RESAMPLE is not powerful for k-line data:

  • still missing FILL by PREV BY COLUMN
  • still missing data if this time is not avaible any data (time from or time end)

Hope questdb team will check this

Describe alternatives you've considered.

image

Example SQL:

SELECT
  FIRST(price) AS open,
  max(price) AS high,
  min(price) AS low,
  last(price) AS close,
  sum(amount) AS volume,
  created_at as timestamp
FROM
  trades
WHERE
  market_id = 'bnbusdt'
SAMPLE BY 15m
FILL(PREV(close), PREV(close), PREV(close), PREV(close), 0) ALIGN TO CALENDAR UNTIL NOW

Additional context.

No response

コントリビューターガイド