Files
greptimedb/tests/cases/standalone/common/tql/binary_operator.result
Ruihang Xia 605776f49c feat: support bool operator with other computation (#1844)
* add some cases

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* fix sqlness test

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* impl atan2 and power

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* fix instant manipulator

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* fix clippy

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
2023-06-29 19:23:54 +08:00

40 lines
1.2 KiB
Plaintext

create table data (ts timestamp(3) time index, val double);
Affected Rows: 0
insert into data values (0, 1), (10000, 2), (20000, 3);
Affected Rows: 3
tql eval (0, 30, '10s'), data < 1;
++
++
tql eval (0, 30, '10s'), data + (1 < bool 2);
+---------------------+-------------------------------+
| ts | val + Float64(1) < Float64(2) |
+---------------------+-------------------------------+
| 1970-01-01T00:00:00 | 2.0 |
| 1970-01-01T00:00:10 | 3.0 |
| 1970-01-01T00:00:20 | 4.0 |
| 1970-01-01T00:00:30 | 4.0 |
+---------------------+-------------------------------+
tql eval (0, 30, '10s'), data + (1 > bool 2);
+---------------------+-------------------------------+
| ts | val + Float64(1) > Float64(2) |
+---------------------+-------------------------------+
| 1970-01-01T00:00:00 | 1.0 |
| 1970-01-01T00:00:10 | 2.0 |
| 1970-01-01T00:00:20 | 3.0 |
| 1970-01-01T00:00:30 | 3.0 |
+---------------------+-------------------------------+
drop table data;
Affected Rows: 1