Files
greptimedb/tests/cases/standalone/common/select/dummy.result
Eugene Tolbakov 5397a9bbe6 feat(to_unixtime): add initial implementation (#1186)
* feat(to_unixtime): add initial implementation

* feat(to_unixtime): use Timestamp for conversion

* feat(to_unixtime):  implement conversion to Result<VectorRef>

* feat(to_unixtime): make unit test pass

* feat(to_unixtime): preserve None for invalid timestamps

* feat(to_unixtime): address code review suggestions

* feat(to_unixtime): add an sqlness test

* feat(to_unixtime): adjust the assertion for the sqlness test

* Update tests/cases/standalone/common/select/dummy.sql

---------

Co-authored-by: Ruihang Xia <waynestxia@gmail.com>
2023-03-21 12:41:07 +00:00

45 lines
835 B
Plaintext

select 1;
+----------+
| Int64(1) |
+----------+
| 1 |
+----------+
select 2 + 3;
+---------------------+
| Int64(2) + Int64(3) |
+---------------------+
| 5 |
+---------------------+
select 4 + 0.5;
+-------------------------+
| Int64(4) + Float64(0.5) |
+-------------------------+
| 4.5 |
+-------------------------+
select "a";
Error: 3000(PlanQuery), No field named 'a'.
select "A";
Error: 3000(PlanQuery), No field named 'A'.
select * where "a" = "A";
Error: 3000(PlanQuery), No field named 'a'.
select TO_UNIXTIME('2023-03-01T06:35:02Z');
+-------------------------------------------+
| to_unixtime(Utf8("2023-03-01T06:35:02Z")) |
+-------------------------------------------+
| 1677652502 |
+-------------------------------------------+