create table t1 (a string primary key, b timestamp time index, c double);

Affected Rows: 0

insert into t1 values ("a", 1000, 1.0), ("b", 2000, 2.0), ("c", 3000, 3.0);

Affected Rows: 3

-- SQLNESS REPLACE (metrics.*) REDACTED
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
-- SQLNESS REPLACE (-+) -
-- SQLNESS REPLACE (\s\s+) _
-- SQLNESS REPLACE (peers.*) REDACTED
-- SQLNESS REPLACE region=\d+\(\d+,\s+\d+\) region=REDACTED
-- SQLNESS REPLACE (Hash.*) REDACTED
tql analyze (1, 3, '1s') t1{ a = "a" };

+-+-+-+
| stage | node | plan_|
+-+-+-+
| 0_| 0_|_CooperativeExec REDACTED
|_|_|_MergeScanExec: REDACTED
|_|_|_|
| 1_| 0_|_PromInstantManipulateExec: range=[1000..3000], lookback=[300000], interval=[1000], time index=[b] REDACTED
|_|_|_PromSeriesDivideExec: tags=["a"] REDACTED
|_|_|_CooperativeExec REDACTED
|_|_|_SeriesScan: region=REDACTED, "partition_count":{"count":1, "mem_ranges":1, "files":0, "file_ranges":0}, "distribution":"PerSeries" REDACTED
|_|_|_|
|_|_| Total rows: 3_|
+-+-+-+

-- SQLNESS REPLACE (metrics.*) REDACTED
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
-- SQLNESS REPLACE (-+) -
-- SQLNESS REPLACE (\s\s+) _
-- SQLNESS REPLACE (peers.*) REDACTED
-- SQLNESS REPLACE region=\d+\(\d+,\s+\d+\) region=REDACTED
-- SQLNESS REPLACE (Hash.*) REDACTED
tql analyze (1, 3, '1s') t1{ a =~ ".*" };

+-+-+-+
| stage | node | plan_|
+-+-+-+
| 0_| 0_|_CooperativeExec REDACTED
|_|_|_MergeScanExec: REDACTED
|_|_|_|
| 1_| 0_|_PromInstantManipulateExec: range=[1000..3000], lookback=[300000], interval=[1000], time index=[b] REDACTED
|_|_|_PromSeriesDivideExec: tags=["a"] REDACTED
|_|_|_CooperativeExec REDACTED
|_|_|_SeriesScan: region=REDACTED, "partition_count":{"count":1, "mem_ranges":1, "files":0, "file_ranges":0}, "distribution":"PerSeries" REDACTED
|_|_|_|
|_|_| Total rows: 6_|
+-+-+-+

-- SQLNESS REPLACE (metrics.*) REDACTED
-- SQLNESS REPLACE (RoundRobinBatch.*) REDACTED
-- SQLNESS REPLACE (-+) -
-- SQLNESS REPLACE (\s\s+) _
-- SQLNESS REPLACE (peers.*) REDACTED
-- SQLNESS REPLACE region=\d+\(\d+,\s+\d+\) region=REDACTED
-- SQLNESS REPLACE (Hash.*) REDACTED
tql analyze (1, 3, '1s') t1{ a =~ "a.*" };

+-+-+-+
| stage | node | plan_|
+-+-+-+
| 0_| 0_|_CooperativeExec REDACTED
|_|_|_MergeScanExec: REDACTED
|_|_|_|
| 1_| 0_|_PromInstantManipulateExec: range=[1000..3000], lookback=[300000], interval=[1000], time index=[b] REDACTED
|_|_|_PromSeriesDivideExec: tags=["a"] REDACTED
|_|_|_CooperativeExec REDACTED
|_|_|_SeriesScan: region=REDACTED, "partition_count":{"count":1, "mem_ranges":1, "files":0, "file_ranges":0}, "distribution":"PerSeries" REDACTED
|_|_|_|
|_|_| Total rows: 3_|
+-+-+-+

drop table t1;

Affected Rows: 0

create table t2 (a string primary key, b timestamp time index, c double);

Affected Rows: 0

INSERT INTO TABLE t2 VALUES
    ('10.0.160.237:8080', 0, 1),
    ('10.0.160.237:8081', 0, 1),
    ('20.0.10.237:8081', 0, 1),
    ('abcx', 0, 1),
    ('xabc', 0, 1);

Affected Rows: 5

-- SQLNESS SORT_RESULT 3 1
tql eval (0, 0, '1s') t2{a=~"10"};

++
++

-- SQLNESS SORT_RESULT 3 1
tql eval (0, 0, '1s') t2{a=~"10.*"};

+-------------------+---------------------+-----+
| a                 | b                   | c   |
+-------------------+---------------------+-----+
| 10.0.160.237:8080 | 1970-01-01T00:00:00 | 1.0 |
| 10.0.160.237:8081 | 1970-01-01T00:00:00 | 1.0 |
+-------------------+---------------------+-----+

-- SQLNESS SORT_RESULT 3 1
tql eval (0, 0, '1s') t2{a=~".*10.*"};

+-------------------+---------------------+-----+
| a                 | b                   | c   |
+-------------------+---------------------+-----+
| 10.0.160.237:8080 | 1970-01-01T00:00:00 | 1.0 |
| 10.0.160.237:8081 | 1970-01-01T00:00:00 | 1.0 |
| 20.0.10.237:8081  | 1970-01-01T00:00:00 | 1.0 |
+-------------------+---------------------+-----+

drop table t2;

Affected Rows: 0

