Files
greptimedb/tests/cases/standalone/common/function/jev.result
T
Lei, HUANG b5199bc59a feat: add experimental Jev SQL filtering (#9265)
* feat: add experimental Jev SQL filtering

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>

* feat: gate Jev filtering behind an opt-in Cargo feature

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>

* ci: verify Jev registration with default features

Run the existing registry regression without the jev feature in both PR tests and merge-queue coverage, alongside the existing feature-enabled test runs.

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>

* docs: clarify Jev concurrency scope and stabilization work

Document the per-expression/batch concurrency bound and track process-wide limiting, rate-limit backoff, and request budgets and metrics as stabilization prerequisites.

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>

* feat: enable renamed ai-functions feature by default

Rename the Jev Cargo feature across the command, query, and function crates and enable it in their defaults. Update CI and documentation, retaining an isolated no-default-features registry check and the runtime API opt-in.

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>

* ci: remove extra AI feature-off checks

Use the regular AI-enabled unit and coverage runs for the default feature configuration. Keep feature-off validation available locally and update the usage guide to match.

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>

* refactor: rename AI feature to ai_functions

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>

---------

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
2026-09-22 03:03:23 +00:00

67 lines
1.6 KiB
Plaintext

-- No credentials or external service needed: NULL propagates without an API call.
SELECT jev(NULL, 'The event reports a failed payment.', 0.8) AS matched;
+---------+
| matched |
+---------+
| |
+---------+
SELECT jev('message', NULL, 0.8) AS matched;
+---------+
| matched |
+---------+
| |
+---------+
SELECT jev('message', 'The event reports a failed payment.', NULL) AS matched;
+---------+
| matched |
+---------+
| |
+---------+
-- Validate SQL registration, coercion, and asynchronous filtering on a real table.
CREATE TABLE jev_events (
occurred_at TIMESTAMP TIME INDEX,
"service" STRING,
"message" STRING,
PRIMARY KEY ("service")
);
Affected Rows: 0
INSERT INTO jev_events VALUES
('2026-09-19T01:00:00Z', 'payments', NULL),
('2026-09-19T02:00:00Z', 'auth', NULL);
Affected Rows: 2
SELECT occurred_at, service, message FROM jev_events
WHERE occurred_at >= '2026-09-19T00:00:00Z'
AND occurred_at < '2026-09-20T00:00:00Z'
AND service = 'payments'
AND jev((message), 'The event reports that a payment still failed after retries.', 0.8)
ORDER BY occurred_at;
+-------------+---------+---------+
| occurred_at | service | message |
+-------------+---------+---------+
+-------------+---------+---------+
DROP TABLE jev_events;
Affected Rows: 0
-- Invalid thresholds fail locally before any HTTP request.
SELECT jev('message', 'condition', -0.1);
Error: 3001(EngineExecuteQuery), Execution error: jev threshold must be finite and in [0, 1]
SELECT jev('message', 'condition', 1.1);
Error: 3001(EngineExecuteQuery), Execution error: jev threshold must be finite and in [0, 1]