mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-11-28 21:54:08 +00:00
The legacy per-request Flow runtime is gone, leaving the batching scheduler as the only execution profile. A flow whose SQL has no time window therefore needs an explicit `EVAL INTERVAL`; without one it used to run as a request-local streaming query and is now rejected with that hint. Persisted flows whose options say `flow_type: streaming` are still listed and droppable, but creating or recovering one fails with a "drop and recreate" error, so no old definition can silently run on a scheduler that no longer exists. `FlowType::Streaming` and `get_flow_type_from_options` stay for deserializing old metadata and old procedure data, and the reserved `flow_type` key keeps being written so the metadata shape does not change. Instant-TTL sources are rejected for every flow: the batching scheduler cannot read them, and there is no second profile to fall back to. The full-row mirror RPC is deliberately kept. It is not a streaming leftover: it is the only path that tells batching that a SQL `INSERT INTO` changed a source table, since bulk/COPY and the HTTP batcher use the timestamp-only path. `BatchingEngine::handle_inserts_inner` filters requests per task by source table name, so forwarding all of them replaces the removed routing table. Dead code that only the streaming runtime reached is removed as well: the stateless query and its memtable source, the relation/repr row model, the single-attempt frontend insert, and the `InsertIntoFlow` error variant. Those were invisible to the compiler because the crate allows dead code. Signed-off-by: discord9 <55937128+discord9@users.noreply.github.com>
254 lines
8.8 KiB
Plaintext
254 lines
8.8 KiB
Plaintext
-- Test: COMMENT ON TABLE add & remove
|
|
CREATE TABLE comment_table_test (
|
|
pk INT,
|
|
val DOUBLE,
|
|
ts TIMESTAMP TIME INDEX,
|
|
PRIMARY KEY(pk)
|
|
);
|
|
|
|
Affected Rows: 0
|
|
|
|
-- Add table comment
|
|
COMMENT ON TABLE comment_table_test IS 'table level description';
|
|
|
|
Affected Rows: 0
|
|
|
|
SHOW CREATE TABLE comment_table_test;
|
|
|
|
+--------------------+---------------------------------------------------+
|
|
| Table | Create Table |
|
|
+--------------------+---------------------------------------------------+
|
|
| comment_table_test | CREATE TABLE IF NOT EXISTS "comment_table_test" ( |
|
|
| | "pk" INT NULL, |
|
|
| | "val" DOUBLE NULL, |
|
|
| | "ts" TIMESTAMP(3) NOT NULL, |
|
|
| | TIME INDEX ("ts"), |
|
|
| | PRIMARY KEY ("pk") |
|
|
| | ) |
|
|
| | |
|
|
| | ENGINE=mito |
|
|
| | WITH( |
|
|
| | comment = 'table level description' |
|
|
| | ) |
|
|
+--------------------+---------------------------------------------------+
|
|
|
|
SELECT table_comment
|
|
FROM information_schema.tables
|
|
WHERE table_schema = 'public'
|
|
AND table_name = 'comment_table_test';
|
|
|
|
+-------------------------+
|
|
| table_comment |
|
|
+-------------------------+
|
|
| table level description |
|
|
+-------------------------+
|
|
|
|
-- Remove table comment
|
|
COMMENT ON TABLE comment_table_test IS NULL;
|
|
|
|
Affected Rows: 0
|
|
|
|
SHOW CREATE TABLE comment_table_test;
|
|
|
|
+--------------------+---------------------------------------------------+
|
|
| Table | Create Table |
|
|
+--------------------+---------------------------------------------------+
|
|
| comment_table_test | CREATE TABLE IF NOT EXISTS "comment_table_test" ( |
|
|
| | "pk" INT NULL, |
|
|
| | "val" DOUBLE NULL, |
|
|
| | "ts" TIMESTAMP(3) NOT NULL, |
|
|
| | TIME INDEX ("ts"), |
|
|
| | PRIMARY KEY ("pk") |
|
|
| | ) |
|
|
| | |
|
|
| | ENGINE=mito |
|
|
| | |
|
|
+--------------------+---------------------------------------------------+
|
|
|
|
SELECT table_comment
|
|
FROM information_schema.tables
|
|
WHERE table_schema = 'public'
|
|
AND table_name = 'comment_table_test';
|
|
|
|
+---------------+
|
|
| table_comment |
|
|
+---------------+
|
|
| |
|
|
+---------------+
|
|
|
|
DROP TABLE comment_table_test;
|
|
|
|
Affected Rows: 0
|
|
|
|
-- Test: COMMENT ON COLUMN add & remove
|
|
CREATE TABLE comment_column_test (
|
|
pk INT,
|
|
val DOUBLE,
|
|
ts TIMESTAMP TIME INDEX,
|
|
PRIMARY KEY(pk)
|
|
);
|
|
|
|
Affected Rows: 0
|
|
|
|
-- Add column comment
|
|
COMMENT ON COLUMN comment_column_test.val IS 'value column description';
|
|
|
|
Affected Rows: 0
|
|
|
|
SHOW CREATE TABLE comment_column_test;
|
|
|
|
+---------------------+---------------------------------------------------------+
|
|
| Table | Create Table |
|
|
+---------------------+---------------------------------------------------------+
|
|
| comment_column_test | CREATE TABLE IF NOT EXISTS "comment_column_test" ( |
|
|
| | "pk" INT NULL, |
|
|
| | "val" DOUBLE NULL COMMENT 'value column description', |
|
|
| | "ts" TIMESTAMP(3) NOT NULL, |
|
|
| | TIME INDEX ("ts"), |
|
|
| | PRIMARY KEY ("pk") |
|
|
| | ) |
|
|
| | |
|
|
| | ENGINE=mito |
|
|
| | |
|
|
+---------------------+---------------------------------------------------------+
|
|
|
|
SELECT column_comment
|
|
FROM information_schema.columns
|
|
WHERE table_schema = 'public'
|
|
AND table_name = 'comment_column_test'
|
|
AND column_name = 'val';
|
|
|
|
+--------------------------+
|
|
| column_comment |
|
|
+--------------------------+
|
|
| value column description |
|
|
+--------------------------+
|
|
|
|
-- Remove column comment
|
|
COMMENT ON COLUMN comment_column_test.val IS NULL;
|
|
|
|
Affected Rows: 0
|
|
|
|
SHOW CREATE TABLE comment_column_test;
|
|
|
|
+---------------------+----------------------------------------------------+
|
|
| Table | Create Table |
|
|
+---------------------+----------------------------------------------------+
|
|
| comment_column_test | CREATE TABLE IF NOT EXISTS "comment_column_test" ( |
|
|
| | "pk" INT NULL, |
|
|
| | "val" DOUBLE NULL, |
|
|
| | "ts" TIMESTAMP(3) NOT NULL, |
|
|
| | TIME INDEX ("ts"), |
|
|
| | PRIMARY KEY ("pk") |
|
|
| | ) |
|
|
| | |
|
|
| | ENGINE=mito |
|
|
| | |
|
|
+---------------------+----------------------------------------------------+
|
|
|
|
SELECT column_comment
|
|
FROM information_schema.columns
|
|
WHERE table_schema = 'public'
|
|
AND table_name = 'comment_column_test'
|
|
AND column_name = 'val';
|
|
|
|
+----------------+
|
|
| column_comment |
|
|
+----------------+
|
|
| |
|
|
+----------------+
|
|
|
|
DROP TABLE comment_column_test;
|
|
|
|
Affected Rows: 0
|
|
|
|
-- Test: COMMENT ON FLOW add & remove
|
|
-- Prepare source & sink tables
|
|
CREATE TABLE flow_source_comment_test (
|
|
desc_str STRING,
|
|
ts TIMESTAMP TIME INDEX
|
|
);
|
|
|
|
Affected Rows: 0
|
|
|
|
CREATE TABLE flow_sink_comment_test (
|
|
desc_str STRING,
|
|
ts TIMESTAMP TIME INDEX
|
|
);
|
|
|
|
Affected Rows: 0
|
|
|
|
CREATE FLOW flow_comment_test
|
|
SINK TO flow_sink_comment_test
|
|
EVAL INTERVAL '1h'
|
|
AS
|
|
SELECT desc_str, ts FROM flow_source_comment_test;
|
|
|
|
Affected Rows: 0
|
|
|
|
-- Add flow comment
|
|
COMMENT ON FLOW flow_comment_test IS 'flow level description';
|
|
|
|
Affected Rows: 0
|
|
|
|
SHOW CREATE FLOW flow_comment_test;
|
|
|
|
+-------------------+------------------------------------------------------+
|
|
| Flow | Create Flow |
|
|
+-------------------+------------------------------------------------------+
|
|
| flow_comment_test | CREATE FLOW IF NOT EXISTS flow_comment_test |
|
|
| | SINK TO public.flow_sink_comment_test |
|
|
| | EVAL INTERVAL '3600 s' |
|
|
| | COMMENT 'flow level description' |
|
|
| | AS SELECT desc_str, ts FROM flow_source_comment_test |
|
|
+-------------------+------------------------------------------------------+
|
|
|
|
SELECT comment
|
|
FROM information_schema.flows
|
|
WHERE flow_name = 'flow_comment_test';
|
|
|
|
+------------------------+
|
|
| comment |
|
|
+------------------------+
|
|
| flow level description |
|
|
+------------------------+
|
|
|
|
-- Remove flow comment
|
|
COMMENT ON FLOW flow_comment_test IS NULL;
|
|
|
|
Affected Rows: 0
|
|
|
|
SHOW CREATE FLOW flow_comment_test;
|
|
|
|
+-------------------+------------------------------------------------------+
|
|
| Flow | Create Flow |
|
|
+-------------------+------------------------------------------------------+
|
|
| flow_comment_test | CREATE FLOW IF NOT EXISTS flow_comment_test |
|
|
| | SINK TO public.flow_sink_comment_test |
|
|
| | EVAL INTERVAL '3600 s' |
|
|
| | AS SELECT desc_str, ts FROM flow_source_comment_test |
|
|
+-------------------+------------------------------------------------------+
|
|
|
|
SELECT comment
|
|
FROM information_schema.flows
|
|
WHERE flow_name = 'flow_comment_test';
|
|
|
|
+---------+
|
|
| comment |
|
|
+---------+
|
|
| |
|
|
+---------+
|
|
|
|
DROP FLOW flow_comment_test;
|
|
|
|
Affected Rows: 0
|
|
|
|
DROP TABLE flow_source_comment_test;
|
|
|
|
Affected Rows: 0
|
|
|
|
DROP TABLE flow_sink_comment_test;
|
|
|
|
Affected Rows: 0
|
|
|