Files
greptimedb/tests/cases/standalone/common/aggregate/distinct_order_by.result
Ruihang Xia 56fc77e573 fix: add missing error display message (#2791)
* fix: add missing error display message

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

* update sqlness result

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

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
2023-11-23 02:59:49 +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 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: This feature is not implemented: DISTINCT ON Exprs not supported
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