Yingwen
76924c2d36
feat(mito2): introduce two-phase metric series scans ( #8826 )
...
* feat(mito2): add two-phase series scan
Signed-off-by: evenyag <realevenyag@gmail.com >
* docs: regenerate configuration reference
Signed-off-by: evenyag <realevenyag@gmail.com >
* test(sqlness): update series scan explain results
Signed-off-by: evenyag <realevenyag@gmail.com >
* test: update config API expectation
Signed-off-by: evenyag <realevenyag@gmail.com >
* fix(mito2): bound two-phase series discovery
Signed-off-by: evenyag <realevenyag@gmail.com >
* fix(mito2): avoid candidate distribution deadlock
Signed-off-by: evenyag <realevenyag@gmail.com >
* chore(mito2): remove obsolete dead code allowances
Signed-off-by: evenyag <realevenyag@gmail.com >
* fix(mito2): share series scan memory pool
Signed-off-by: evenyag <realevenyag@gmail.com >
---------
Signed-off-by: evenyag <realevenyag@gmail.com >
2026-08-14 06:32:17 +00:00
jeremyhi
764c93bf43
perf(query): choose bounded CTE as hash join build side ( #8807 )
...
* fix(query): choose bounded CTE as hash join build side
Signed-off-by: jeremyhi <fengjiachun@gmail.com >
* perf(query): remove join estimate cap
* test(compat): accept repartition in analyze plan
Signed-off-by: jeremyhi <fengjiachun@gmail.com >
---------
Signed-off-by: jeremyhi <fengjiachun@gmail.com >
2026-08-13 10:51:53 +00:00
discord9
fbbe5af767
fix(query): avoid unsafe count wildcard rewrites ( #8522 )
...
* fix(query): avoid unsafe count wildcard rewrites
Signed-off-by: discord9 <discord9@163.com >
* fix(query): preserve outer count alias
Signed-off-by: discord9 <discord9@163.com >
* fix(query): address review comments on count wildcard rewrite
- Remove the has_projection check: the row count is correct regardless
of whether a projection exists (per review).
- Explain why checking the first input is equivalent to checking all
inputs (a plan with zero inputs falls back to count(1)).
- Rename qa_ prefixed tests to follow the module convention.
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com >
* test(tql): update tql-cte expectations for count wildcard rewrite
The QP-026 count-wildcard fix rewrites count(*) -> count(time_index), so
the EXPLAIN output for the filtered/final CTE aggregates names the
time-index column. Aligns tql-cte.result with the actual output (CI
failure).
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com >
---------
Signed-off-by: discord9 <discord9@163.com >
Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com >
2026-08-07 06:46:46 +00:00
discord9
9776d88dc8
fix: preserve dictionary regex filter semantics ( #8688 )
...
* fix: preserve dictionary regex filter semantics
Signed-off-by: discord9 <discord9@163.com >
* test(query): update dictionary regex plan results
Signed-off-by: discord9 <discord9@163.com >
---------
Signed-off-by: discord9 <discord9@163.com >
2026-07-30 06:20:57 +00:00
Ruihang Xia
0479c05092
perf: preserve dictionary-encoded query labels ( #8541 )
...
* perf: preserve dictionary-encoded query labels
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* fix(client): skip dictionary Flight batches
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* fix(servers): decode dictionary labels in HTTP output
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* test(mito2): support dictionary tags in series scans
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* fix(servers): preserve dictionary child nulls in SQL
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* fix(promql): compare dictionary tags by logical nulls
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* fix(query): keep dictionary tags within query paths
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* refactor(query): scope PK dictionary encoding to reads
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* fix(query): preserve pushdown for dictionary labels
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* fix(query): handle dictionary labels in query operators
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* fix(query): complete label type matching
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* fix(query): align dictionary query schemas
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* fix(query): decode incompatible OR labels
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* fix(query): preserve dictionary partition pruning
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* fix: handle dictionary query edge cases
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* fix: import dictionary downcast macro
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
---------
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
2026-07-17 13:57:10 +00:00
discord9
2123108db0
fix(promql): preserve ordinary NaN samples ( #8494 )
...
* fix(promql): distinguish stale markers from NaN
Signed-off-by: discord9 <discord9@163.com >
* fix(promql): preserve ordinary NaN samples
Signed-off-by: discord9 <discord9@163.com >
---------
Signed-off-by: discord9 <discord9@163.com >
2026-07-15 01:54:49 +00:00
discord9
b30765e5e9
fix: preserve distributed topk merge ordering ( #8432 )
...
* fix: preserve distributed topk for scalar latest
Signed-off-by: discord9 <discord9@163.com >
* fix: preserve scalar latest ordering across merge scan
Signed-off-by: discord9 <discord9@163.com >
* fix: carry merge scan ordering from planner rewrite
Signed-off-by: discord9 <discord9@163.com >
* test: cover merge scan ordering metadata
Signed-off-by: discord9 <discord9@163.com >
* test: cover merge scan partition ordering gate
Signed-off-by: discord9 <discord9@163.com >
* fix: require adjacent merge sort for ordering metadata
Signed-off-by: discord9 <discord9@163.com >
* test: update ordering sqlness plans
Signed-off-by: discord9 <discord9@163.com >
* fix: preserve distributed topk merge ordering
Signed-off-by: discord9 <discord9@163.com >
* test: cover latest per series queries
Signed-off-by: discord9 <discord9@163.com >
* test: update distributed merge sort sqlness
Signed-off-by: discord9 <discord9@163.com >
* test: cover merge scan ordering partition gate
Signed-off-by: discord9 <discord9@163.com >
* test: cover merge scan over-partition ordering
Signed-off-by: discord9 <discord9@163.com >
* test: cover distributed latest with low parallelism
Signed-off-by: discord9 <discord9@163.com >
* fix: keep distributed merge sort opaque
Signed-off-by: discord9 <discord9@163.com >
* test: assert distributed scalar latest merge sort
Signed-off-by: discord9 <discord9@163.com >
* test: clarify merge scan ordering helper
Signed-off-by: discord9 <discord9@163.com >
* fix: complete merge sort exec delegation
Signed-off-by: discord9 <discord9@163.com >
* docs: explain merge sort limit pushdown
Signed-off-by: discord9 <discord9@163.com >
* test: cover merge sort optimizer opacity
Signed-off-by: discord9 <discord9@163.com >
* docs: explain merge sort optimizer hooks
Signed-off-by: discord9 <discord9@163.com >
* test: cover merge sort optimizer hooks
Signed-off-by: discord9 <discord9@163.com >
* fix: preserve merge sort child topk
Signed-off-by: discord9 <discord9@163.com >
* test: update order by topk plan
Signed-off-by: discord9 <discord9@163.com >
* fix: recognize merge sort global fetch
Signed-off-by: discord9 <discord9@163.com >
---------
Signed-off-by: discord9 <discord9@163.com >
2026-07-14 12:53:07 +00:00
discord9
4f5dccf6bb
fix(query): push down PromQL cast filters ( #8407 )
...
* fix(query): push down PromQL cast filters
Signed-off-by: discord9 <discord9@163.com >
* test(query): cover cast preimage pushdown
Signed-off-by: discord9 <discord9@163.com >
* test(query): expand cast preimage coverage
Signed-off-by: discord9 <discord9@163.com >
* test(query): compare cast normalization rules
Signed-off-by: discord9 <discord9@163.com >
* test(query): update cast pushdown sqlness plans
Signed-off-by: discord9 <discord9@163.com >
---------
Signed-off-by: discord9 <discord9@163.com >
2026-07-03 09:10:00 +00:00
discord9
9cf071808a
fix(query): run optimizer rules before MergeScan ( #8339 )
...
* fix(query): push down join filters before MergeScan
Signed-off-by: discord9 <discord9@163.com >
* fix(query): run optimizer before MergeScan pushdown
Signed-off-by: discord9 <discord9@163.com >
* fix(query): narrow pre-MergeScan filter pushdown
Signed-off-by: discord9 <discord9@163.com >
* fix(query): refine pre-MergeScan optimizer prepass
Signed-off-by: discord9 <discord9@163.com >
* fix(query): satisfy predicate extractor clippy
Signed-off-by: discord9 <discord9@163.com >
* test(query): cover pre-MergeScan optimizer edges
Signed-off-by: discord9 <discord9@163.com >
* test(query): cover set comparison prepass
Signed-off-by: discord9 <discord9@163.com >
* fix(query): guard remote scan filter pushdown
Signed-off-by: discord9 <discord9@163.com >
* fix(query): preserve subquery planning errors
Signed-off-by: discord9 <discord9@163.com >
* fix(query): preserve usable scan predicates
Signed-off-by: discord9 <discord9@163.com >
* fix(query): simplify scan predicate extraction
Signed-off-by: discord9 <discord9@163.com >
* fix(query): keep scan filter extraction scoped
Signed-off-by: discord9 <discord9@163.com >
* docs(query): explain pre-MergeScan optimizer
Signed-off-by: discord9 <discord9@163.com >
---------
Signed-off-by: discord9 <discord9@163.com >
2026-06-23 12:15:40 +00:00
discord9
30e895abbe
fix: prom cast to f64 ( #7840 )
...
* fix: cast to f64
Signed-off-by: discord9 <discord9@163.com >
* test: div case
Signed-off-by: discord9 <discord9@163.com >
* test: int test
Signed-off-by: discord9 <discord9@163.com >
* chore: sqlness update
Signed-off-by: discord9 <discord9@163.com >
* chore: test
Signed-off-by: discord9 <discord9@163.com >
* chore: update test
Signed-off-by: discord9 <discord9@163.com >
---------
Signed-off-by: discord9 <discord9@163.com >
2026-03-24 06:24:52 +00:00
b2074e3863
chore: upgrade DataFusion family, again ( #7578 )
...
* chore: upgrade DataFusion family
Signed-off-by: luofucong <luofc@foxmail.com >
* chore: switch to released version of datafusion-pg-catalog
---------
Signed-off-by: luofucong <luofc@foxmail.com >
Co-authored-by: Ning Sun <sunning@greptime.com >
Co-authored-by: Ning Sun <sunng@protonmail.com >
2026-03-03 07:36:39 +00:00
Ruihang Xia
4ac73a7e9e
feat: adapt prometheus 3.x selector and lookback behavior ( #7688 )
...
* feat: adapt prometheus 3.x selector and lookback behavior
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* remove commit hash from comment
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
---------
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
2026-02-10 04:00:45 +00:00
Ruihang Xia
a10d40e552
feat: adapt prometheus 3.x matrix selector behavior change ( #7671 )
...
feat: adapt prometheus 3.x matrix selector behavior
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
2026-02-06 03:06:33 +00:00
LFC
e64c31e59a
chore: upgrade DataFusion family ( #7558 )
...
* chore: upgrade DataFusion family
Signed-off-by: luofucong <luofc@foxmail.com >
* use main proto
Signed-off-by: luofucong <luofc@foxmail.com >
* fix ci
Signed-off-by: luofucong <luofc@foxmail.com >
---------
Signed-off-by: luofucong <luofc@foxmail.com >
2026-01-14 14:02:31 +00:00
discord9
ac6d68aa2d
fix: simp expr recursively ( #7523 )
...
* fix: simp expr recursively
Signed-off-by: discord9 <discord9@163.com >
* test: some simple constant folding case
Signed-off-by: discord9 <discord9@163.com >
* fix: literal ts cast to UTC
Signed-off-by: discord9 <discord9@163.com >
* fix: patch merge scan batch col tz instead
Signed-off-by: discord9 <discord9@163.com >
* test: fix
Signed-off-by: discord9 <discord9@163.com >
---------
Signed-off-by: discord9 <discord9@163.com >
2026-01-07 09:22:26 +00:00
Ruihang Xia and Ning Sun
9a4b7cbb32
feat: bump promql-parser to v0.7.1 ( #7521 )
...
* feat: bump promql-parser to v0.7.0
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* add sqlness tests
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* update other sqlness results
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* Update tests/cases/standalone/common/tql/case_sensitive.result
Co-authored-by: Ning Sun <sunng@protonmail.com >
* remove escape on greptimedb side
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* update to v0.7.1
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* remove unused deps
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
---------
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
Co-authored-by: Ning Sun <sunng@protonmail.com >
2026-01-07 07:23:40 +00:00
Ruihang Xia
bd3ad60910
fix: promql offset direction ( #7392 )
...
* fix: promql offset direction
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* sort sqlness result
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* commit forgotten file
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
---------
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
2025-12-12 07:51:35 +00:00
Ruihang Xia
c054c13e48
perf: avoid unnecessary merge sort ( #7274 )
...
* perf: avoid unnecessary merge sort
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* fantastic if chain
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* more comments
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* fix typo
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
---------
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
2025-11-21 09:02:25 +00:00
LFC and Ning Sun
2f637a262e
chore: update datafusion to 50 ( #7076 )
...
* chore: update datafusion to 50
Signed-off-by: luofucong <luofc@foxmail.com >
* fix ci
Signed-off-by: luofucong <luofc@foxmail.com >
* fix: update datafusion_pg_catalog import
* chore: fix toml format
* chore: fix toml format again
* fix nextest
Signed-off-by: luofucong <luofc@foxmail.com >
* fix sqlness
Signed-off-by: luofucong <luofc@foxmail.com >
* chore: switch datafusion-orc to upstream tag
* fix sqlness
Signed-off-by: luofucong <luofc@foxmail.com >
* resolve PR comments
Signed-off-by: luofucong <luofc@foxmail.com >
---------
Signed-off-by: luofucong <luofc@foxmail.com >
Co-authored-by: Ning Sun <sunning@greptime.com >
2025-10-23 07:18:36 +00:00
discord9 and Yingwen
ba034c5a9e
feat: explain custom statement ( #7058 )
...
* feat: explain tql cte
Signed-off-by: discord9 <discord9@163.com >
* chore: unused
Signed-off-by: discord9 <discord9@163.com >
* fix: analyze format
Signed-off-by: discord9 <discord9@163.com >
* Update src/sql/src/statements/statement.rs
Co-authored-by: Yingwen <realevenyag@gmail.com >
Signed-off-by: discord9 <discord9@163.com >
* test: sqlness
Signed-off-by: discord9 <discord9@163.com >
* pcr
Signed-off-by: discord9 <discord9@163.com >
---------
Signed-off-by: discord9 <discord9@163.com >
Co-authored-by: Yingwen <realevenyag@gmail.com >
2025-10-11 06:27:51 +00:00
dennis zhuang
57d84b9de5
feat: supports value aliasing in TQL ( #7041 )
...
* feat: supports value aliasing in TQL
Signed-off-by: Dennis Zhuang <killme2008@gmail.com >
* fix: invalid checking
Signed-off-by: Dennis Zhuang <killme2008@gmail.com >
* chore: remove invalid checking
Signed-off-by: Dennis Zhuang <killme2008@gmail.com >
* test: add explain test
Signed-off-by: Dennis Zhuang <killme2008@gmail.com >
* chore: improve parser
Signed-off-by: Dennis Zhuang <killme2008@gmail.com >
* test: add explain TQL-CTE
Signed-off-by: Dennis Zhuang <killme2008@gmail.com >
---------
Signed-off-by: Dennis Zhuang <killme2008@gmail.com >
2025-10-11 02:49:09 +00:00
dennis zhuang
17d16da483
feat: supports expression in TQL params ( #7014 )
...
* feat: supports expression in TQL params
Signed-off-by: Dennis Zhuang <killme2008@gmail.com >
* chore: by cr comments
Signed-off-by: Dennis Zhuang <killme2008@gmail.com >
* chore: comment
Signed-off-by: Dennis Zhuang <killme2008@gmail.com >
* chore: by cr comments
Signed-off-by: Dennis Zhuang <killme2008@gmail.com >
---------
Signed-off-by: Dennis Zhuang <killme2008@gmail.com >
2025-09-26 03:43:50 +00:00
Ruihang Xia
c7050831db
fix: match promql column reference in case sensitive way ( #7013 )
...
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
2025-09-24 03:28:09 +00:00
Ruihang Xia
4158afa618
fix: wrap tql cte in a subquery alias ( #6910 )
...
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
2025-09-05 06:07:20 +00:00
Ruihang Xia
288f69a30f
fix: plan disorder from upgrading datafusion ( #6787 )
...
* fix: plan disorder from upgrading datafusion
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* update sqlness
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* update sqlness again
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
---------
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
2025-08-23 12:29:47 +00:00
LFC
f9d2a89a0c
chore: update datafusion family ( #6675 )
...
* chore: update datafusion family
Signed-off-by: luofucong <luofc@foxmail.com >
* fix ci
Signed-off-by: luofucong <luofc@foxmail.com >
* use official otel-arrow-rust
Signed-off-by: luofucong <luofc@foxmail.com >
* rebase
Signed-off-by: luofucong <luofc@foxmail.com >
* use the official orc-rust
Signed-off-by: luofucong <luofc@foxmail.com >
* resolve PR comments
Signed-off-by: luofucong <luofc@foxmail.com >
* remove the empty lines
Signed-off-by: luofucong <luofc@foxmail.com >
* try following PR comments
Signed-off-by: luofucong <luofc@foxmail.com >
---------
Signed-off-by: luofucong <luofc@foxmail.com >
2025-08-15 12:41:49 +00:00
Ruihang Xia
2992e70393
fix: correct offset's symbol ( #6728 )
...
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
2025-08-13 03:20:47 +00:00
Ruihang Xia
3b1f172ab8
fix: TQL CTE parser take raw query string ( #6671 )
...
* take raw TQL part
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* more tests
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* sort sqlness result
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* add order by
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* more order by
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* add comment back
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
---------
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
2025-08-08 06:22:56 +00:00
Ruihang Xia
309e9d978c
feat: support TQL CTE in planner ( #6645 )
...
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
2025-08-06 04:07:38 +00:00
Yingwen
40363bfc0f
fix: range query returns range selector error when table not found ( #6481 )
...
* test: add sqlness test for range vector with non-existence metric
Signed-off-by: evenyag <realevenyag@gmail.com >
* fix: handle empty metric for matrix selector
Signed-off-by: evenyag <realevenyag@gmail.com >
* test: update sqlness result
Signed-off-by: evenyag <realevenyag@gmail.com >
* chore: add newline
Signed-off-by: evenyag <realevenyag@gmail.com >
---------
Signed-off-by: evenyag <realevenyag@gmail.com >
2025-07-10 01:53:23 +00:00
Ning Sun
eeb061ca74
feat: allow float number literal in step ( #6483 )
...
* chore: allow float number literal as step
Signed-off-by: Ning Sun <sunning@greptime.com >
* chore: switch to released version of promql parser
Signed-off-by: Ning Sun <sunning@greptime.com >
---------
Signed-off-by: Ning Sun <sunning@greptime.com >
2025-07-09 03:09:09 +00:00
Yingwen
2a3445c72c
fix: ignore missing columns and tables in PromQL ( #6285 )
...
* fix: handle table/column not found in or
Signed-off-by: evenyag <realevenyag@gmail.com >
* test: update result
Signed-off-by: evenyag <realevenyag@gmail.com >
* test: drop table after test
Signed-off-by: evenyag <realevenyag@gmail.com >
* test: fix test cases
Signed-off-by: evenyag <realevenyag@gmail.com >
* fix: do not return table not found error in series_query
Signed-off-by: evenyag <realevenyag@gmail.com >
---------
Signed-off-by: evenyag <realevenyag@gmail.com >
2025-06-16 12:15:38 +00:00
Ruihang Xia
7468a8ab2a
feat: organize EXPLAIN ANALYZE VERBOSE's output in JSON format ( #6308 )
...
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
2025-06-12 09:55:53 +00:00
Ruihang Xia
791f530a78
fix: require input ordering in series divide plan ( #6148 )
...
* require input ordering in series divide plan
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* add sqlness case
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* finilise
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
---------
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
2025-05-22 07:04:25 +00:00
Yingwen and Ruihang Xia
c7e9485534
feat: New scanner SeriesScan to scan by series for querying metrics ( #5968 )
...
* chore: basic methods for SeriesScan
* chore: add to scanner enum
* feat: implement scan logic of each partition
* feat: use series scan when distribution is PerSeries
* refactor: remove per series scan from SeqScan
* fix: use series scan in PerSeries distribution
* feat: keep parallelize_scan unchanged
* fix: address compiler errors
* fix: include build merge reader cost to scan cost
* feat: use smallvec
* chore: update comment
* Revert "feat: keep parallelize_scan unchanged"
This reverts commit 96ba00d175 .
* assign partition_ranges
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* feat: try send before send
reduce the send timeout to 10ms
* chore: add comments
* fix: add metrics to partition metrics list
* fix: correct scan cost metrics
* chore: reset instant
* fix: scanner metrics init
* chore: display more info in explain
* feat: metrics for send series timeout
* style: fix clippy
* refactor: use ChainedRecordBatchStream to simplify codes
* chore: fix typos
* feat: separate distributor metrics
* feat: remove parallelize hack
* chore: fix warning
* test: add test for series scan
* test: update sqlness test
---------
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
Co-authored-by: Ruihang Xia <waynestxia@gmail.com >
2025-05-16 08:53:24 +00:00
Ruihang Xia
bbb6f8685e
feat: implement commutativity rule for prom-related plans ( #5875 )
...
* feat: implement commutativity rule for prom-related plans
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* fix range manipulate deserializer
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* blocklist in commutativity rule
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* change dictionary type
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* handle partition and ordering
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* fix clippy
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* update tests
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* add rate, increase and delta
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* update sqlness result
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* regexp_replace uses empty string instead of null value
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* update sqlness result
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* update sqlness result
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* update sqlness result again
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
---------
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
2025-05-13 09:06:25 +00:00
Ruihang Xia
0fb9e1995e
fix: preserve timestamp precision of irate ( #5904 )
...
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
2025-04-15 15:00:30 +00:00
Ruihang Xia
c16bae32c4
perf: evolve promql execution engine ( #5691 )
...
* use the same sort option across every prom plan
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* tweak plans
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* wip
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* fix merge compile
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* Revert "wip"
This reverts commit db58884236 .
* tweak merge scan
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* handle error
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* pass distribution rule
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* reverse sort order
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* refine plans
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* more optimizations for plans
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* check logical table
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* fix tests
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* wierd tests
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* add comment
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* add test for series_divide
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* update sqlness result
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* fix scalar calculation
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* update sqlness result
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* fix: workaround join partition
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* update proto
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
---------
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
2025-04-08 08:12:15 +00:00
Ning Sun
198ee87675
feat: alias database matcher for promql ( #5522 )
...
* feat: provide an alias db matcher for promql
* refactor: rename __db__ to __database__
* chore: fix sqlness test
2025-02-13 08:37:37 +00:00
35b635f639
feat!: Bump datafusion, prost, hyper, tonic, tower, axum ( #5417 )
...
* change dep
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* feat: adapt to arrow's interval array
* chore: fix compile errors in datatypes crate
* chore: fix api crate compiler errors
* chore: fix compiler errors in common-grpc
* chore: fix common-datasource errors
* chore: fix deprecated code in common-datasource
* fix promql and physical plan related
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* wip: upgrading network deps
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* block on updating `sqlparser`
* upgrade sqlparser
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* adapt new df's trait requirements
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* chore: fix compiler errors in mito2
* chore: fix common-function crate errors
* chore: fix catalog errors
* change import path
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* chore: fix some errors in query crate
* chore: fix some errors in query crate
* aggr expr and some other tiny fixes
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* chore: fix expr related errors in query crate
* chore: fix query serializer and admin command
* chore: fix grpc services
* feat: axum serve
* chore: fix http server
* remove handle_error handler
* refactor timeout layer
* serve axum
* chore: fix flow aggr functions
* chore: fix flow
* feat: fix errors in meta-srv
* boxed()
* use TokioIo
* feat!: Remove script crate and python feature (#5321 )
* feat: exclude script crate
* chore: simplify feature
* feat: remove the script crate
* chore: remove python feature and some comments
* chore: fix warning
* chore: fix servers tests compiler errors
* feat: fix tests-integration errors
* chore: fix unused
* test: fix catalog test
* chore: fix compiler errors for crates using common-meta
testing feature is enabled when check with --workspace
* test: use display for logical plan test
* test: implement rewrite for ScanHintRule
* fix: http server build panic
* test: fix mito test
* fix: sql parser type alias error
* test: fix TestClient not listen
* test: some flow tests
* test(flow): more fix
* fix: test_otlp_logs
* test: fix promql test that using deprecated method fun()
* fix: sql type replace supports Int8 ~ Int64, UInt8 ~ UInt64
* test: fix infer schema test case
* test: fix tests related to plan display
* chore: fix last flow test
* test: fix function format related assertion
* test: use larger port range for tests
* fix: test_otlp_traces
* fix: test_otlp_metrics
* fix range query and dist plan
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* fix: flow handle distinct use deprecated field
* fix: can't pass Join plan expressions to LogicalPlan::with_new_exprs
* test: fix deserialize test
* test: reduce split key case num
* tests: lower case aggr func name
* test: fix some sqlness tests
* tests: more sqlness fix
* tests: fixed sqlness test
* commit non-bug changes
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* fix: make our udf correct
* fix: implement empty methods of ContextProvider for DfContextProviderAdapter
* test: update sqlness test result
* chore: remove unused
* fix: provide alias name for AggregateExprBuilder in range plan
* test: update range query result
* fix: implement missing ContextProvider methods for DfContextProviderAdapter
* test: update timestamps, cte result
* fix: supports empty projection in mito
* test: update comment for cte test
* fix: support projection for numbers
* test: update test cases after projection fix
* fix: fix range select first_value/last_value
* fix: handle CAST and time index conflict
* fix: handle order by correctly in range first_value/last_value
* test: update sqlness result
* test: update view test result
* test: update decimal test
wait for https://github.com/apache/datafusion/pull/14126 to fix this
* feat: remove redundant physical optimization
todo(ruihang): Check if we can remove this.
* test: update sqlness test result
* chore: range select default sort use nulls_first = false
* test: update filter push down test result
* test: comment deciaml test to avoid different panic message
* test: update some distributed test result
* test: update test for distributed count and filter push down
* test: update subqueries test
* fix: SessionState may overwrite our UDFs
* chore: fix compiler errors after merging main
* fix: fix elasticsearch and dashboard router panic
* chore: fix common-functions tests
* chore: update sqlness result
* test: fix id keyword and update sqlness result
* test: fix flow_null test
* fix: enlarge thread size in debug mode to avoid overflow
* chore: fix warnings in common-function
* chore: fix warning in flow
* chore: fix warnings in query crate
* chore: remove unused warnings
* chore: fix deprecated warnings for parquet
* chore: fix deprecated warning in servers crate
* style: fix clippy
* test: enlarge mito cache tttl test ttl time
* chore: fix typo
* style: fmt toml
* refactor: reimplement PartialOrd for RangeSelect
* chore: remove script crate files introduced by merge
* fix: return error if sql option is not kv
* chore: do not use ..default::default()
* chore: per review
* chore: update error message in BuildAdminFunctionArgsSnafu
Co-authored-by: jeremyhi <jiachun_feng@proton.me >
* refactor: typed precision
* update sqlness view case
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* chore: flow per review
* chore: add example in comment
* chore: warn if parquet stats of timestamp is not INT64
* style: add a newline before derive to make the comment more clear
* test: update sqlness result
* fix: flow from substrait
* chore: change update_range_context log to debug level
* chore: move axum-extra axum-macros to workspace
---------
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
Co-authored-by: Ruihang Xia <waynestxia@gmail.com >
Co-authored-by: luofucong <luofc@foxmail.com >
Co-authored-by: discord9 <discord9@163.com >
Co-authored-by: shuiyisong <xixing.sys@gmail.com >
Co-authored-by: jeremyhi <jiachun_feng@proton.me >
2025-01-23 06:15:40 +00:00
Ruihang Xia
f04d380259
fix: validate matcher op for __name__ in promql ( #5191 )
...
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
2024-12-18 08:51:46 +00:00
Ruihang Xia
a889ea88ca
fix: case sensitive for __field__ matcher ( #4822 )
...
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
2024-10-14 03:18:59 +00:00
Eugene Tolbakov
bbea651d08
feat(promql): parameterize lookback ( #3630 )
...
* feat(promql): parameterize lookback
* chore(promql): address CR, adjusted sqlness
* chore(promql): fmt
* chore(promql): fix accidental removal
* fix(promql): address CR
* fix(promql): address CR
* feat(promql): add initial lookback parameter grpc support
* fix: update greptime-proto revision
* chore: restore accidental removal
2024-04-15 09:11:21 +00:00
Weny Xu
097a0371dc
test(sqlness): release databases after tests ( #3648 )
2024-04-07 09:35:34 +00:00
Ning Sun and Ruihang Xia
500f9f10fc
feat: allow cross-schema query in promql ( #3545 )
...
* feat: add __schema__ tag for promql parser
* feat: disable matcher op other than equals
* test: add more test to ensure context getting reset
* test: add integration test
* test: refactor tests
* refactor: remove duplicated test code
* refactor: update according to review comments
* test: add sqlness test for cross schema scenario
---------
Co-authored-by: Ruihang Xia <waynestxia@gmail.com >
2024-03-29 07:41:01 +00:00
Eugene Tolbakov
14267c2aed
feat(tql): add initial support for start,stop,step as sql functions ( #3507 )
...
* feat(tql): add initial support for start,stop,step as sql functions
* fix(tql): remove unwraps, adjust fmt
* fix(tql): address taplo issue
* feat(tql): update parse_tql_query logic
* fix(tql): change query parsing logic to use parser instead of delimiter
* fix(tql): add timestamp function support, add sqlness tests
* fix(tql): add lookback optional param for tql eval
* fix(tql): adjust tests for now() function
* fix(tql): introduce the tqlerror to differentiate failures on parsing, evaluation and simplification stages
* fix(tql): add tests for explain/analyze
* feat(tql): add lookback support for explain/analyze, update tests
* feat(tql): add more sqlness tests
* chore(tql): extract common logic for eval, analyze and explain into a single function
* feat(tql): address CR points
* feat(tql): use snafu for tql errors, add more docs
* feat(tql): address CR points
2024-03-29 06:37:25 +00:00
Ruihang Xia
2f98fa0d97
fix: correct the case sensitivity behavior for PromQL ( #3296 )
...
* fix: correct the case sensitivity behavior for PromQL
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* remove debug code
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* consolidate sqlness case
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* drop table
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
---------
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
2024-02-08 03:26:32 +00:00
Ruihang Xia
8cc7129397
fix: remove __name__ matcher from processed matcher list ( #3213 )
...
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
2024-01-22 08:50:28 +00:00
Ruihang Xia
0882da4d01
feat: support PromQL operations over the same metric ( #3124 )
...
* update sqlness result
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* update ut cases
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* remove deadcode
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
---------
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
2024-01-11 23:07:17 +00:00
Ruihang Xia and Yingwen
10ecc30817
feat: pushdown aggr, limit and sort plan ( #2495 )
...
* check partition for aggr plan
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* handle empty partition rule
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* remove CheckPartition option
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* add test
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* update some valid sqlness result
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* opt-out promql plan and update sqlness
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* fix limit
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* fix insert select subquery
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* update unit test result
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* fix typo
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
* Update src/query/src/dist_plan/analyzer.rs
Co-authored-by: Yingwen <realevenyag@gmail.com >
---------
Signed-off-by: Ruihang Xia <waynestxia@gmail.com >
Co-authored-by: Yingwen <realevenyag@gmail.com >
2023-09-28 06:35:45 +00:00