Files
greptimedb/tests/cases/standalone/common/aggregate/distinct_order_by.result
Ruihang Xia c2218f8be8 build(deps): bump datafusion 20240528 (#4061)
* build(deps): bump datafusion 20240528

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

* another update

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

* update expected sqlness result

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

* fix first/last value

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

* reformat comment

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

* fix remaining errors

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

* revert toml format

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

* fix pyo3 feature

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

* remove dead code

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

* Apply suggestions from code review

Co-authored-by: Jeremyhi <jiachun_feng@proton.me>

* format file

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

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
Co-authored-by: Jeremyhi <jiachun_feng@proton.me>
2024-06-01 14:03:00 +00:00

68 lines
1.3 KiB
Plaintext

CREATE TABLE integers(i bigint, ts TIMESTAMP TIME INDEX);
Affected Rows: 0
INSERT INTO integers VALUES (1, 1), (2, 2), (3, 3);
Affected Rows: 3
SELECT DISTINCT i%2 FROM integers ORDER BY 1;
+-----------------------+
| integers.i % Int64(2) |
+-----------------------+
| 0 |
| 1 |
+-----------------------+
-- TODO(LFC): Failed to run under new DataFusion
-- expected:
-- +-----------------------+
-- | integers.i % Int64(2) |
-- +-----------------------+
-- | 1 |
-- | 0 |
-- +-----------------------+
SELECT DISTINCT i % 2 FROM integers WHERE i<3 ORDER BY i;
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: For SELECT DISTINCT, ORDER BY expressions integers.i must appear in select list
SELECT DISTINCT ON (1) i % 2, i FROM integers WHERE i<3 ORDER BY i;
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: SELECT DISTINCT ON expressions must match initial ORDER BY expressions
SELECT DISTINCT integers.i FROM integers ORDER BY i DESC;
+---+
| i |
+---+
| 3 |
| 2 |
| 1 |
+---+
SELECT DISTINCT i FROM integers ORDER BY integers.i DESC;
+---+
| i |
+---+
| 3 |
| 2 |
| 1 |
+---+
SELECT DISTINCT integers.i FROM integers ORDER BY integers.i DESC;
+---+
| i |
+---+
| 3 |
| 2 |
| 1 |
+---+
DROP TABLE integers;
Affected Rows: 0