mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-13 00:32:56 +00:00
* generate exec plan Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * move DatanodeClients to client crate Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * wip MergeScanExec::to_stream Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * fix compile errors Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * fix default catalog Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * fix expand order of new stage Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * move sqlness cases contains plan out of common dir Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * refactor information schema to allow duplicated scan call Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * fix: ignore two cases due to substrait Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * reorganise sqlness common cases Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * fix typos Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * redact round robin partition number Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * Apply suggestions from code review Co-authored-by: Yingwen <realevenyag@gmail.com> * skip tranforming projection Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * update sqlness result Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * revert common/order Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * fix clippy Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * Update src/query/src/dist_plan/merge_scan.rs Co-authored-by: JeremyHi <jiachun_feng@proton.me> * update sqlness result Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * update sqlness result again Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * resolve CR comments Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * ignore region failover IT Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * update sqlness result again and again Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * unignore some tests about projection Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * enable failover tests Signed-off-by: Ruihang Xia <waynestxia@gmail.com> --------- Signed-off-by: Ruihang Xia <waynestxia@gmail.com> Co-authored-by: Yingwen <realevenyag@gmail.com> Co-authored-by: JeremyHi <jiachun_feng@proton.me>
28 lines
2.0 KiB
SQL
28 lines
2.0 KiB
SQL
CREATE TABLE test(i INTEGER, j INTEGER, t BIGINT TIME INDEX);
|
|
|
|
INSERT INTO test VALUES (1, 1, 1), (NULL, 1, 2), (1, NULL, 3);
|
|
|
|
SELECT * FROM test ORDER BY i NULLS FIRST, j NULLS LAST;
|
|
|
|
SELECT * FROM test ORDER BY i NULLS FIRST, j NULLS FIRST;
|
|
|
|
SELECT * FROM test ORDER BY i NULLS LAST, j NULLS FIRST;
|
|
|
|
-- TODO(ruihang): The following two SQL will fail under distributed mode with error
|
|
-- Error: 1003(Internal), status: Internal, message: "Failed to collect recordbatch, source: Failed to poll stream, source: Arrow error: Invalid argument error: batches[0] schema is different with argument schema.\n batches[0] schema: Schema { fields: [Field { name: \"i\", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: \"j\", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: \"t\", data_type: Int64, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {\"greptime:time_index\": \"true\"} }], metadata: {\"greptime:version\": \"0\"} },\n argument schema: Schema { fields: [Field { name: \"i\", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: \"j\", data_type: Int32, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }, Field { name: \"t\", data_type: Int64, nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {\"greptime:time_index\": \"true\"} }], metadata: {} }\n ", details: [], metadata: MetadataMap { headers: {"inner_error_code": "Internal"} }
|
|
-- SELECT i, j, row_number() OVER (PARTITION BY i ORDER BY j NULLS FIRST) FROM test ORDER BY i NULLS FIRST, j NULLS FIRST;
|
|
|
|
-- SELECT i, j, row_number() OVER (PARTITION BY i ORDER BY j NULLS LAST) FROM test ORDER BY i NULLS FIRST, j NULLS FIRST;
|
|
|
|
SELECT * FROM test ORDER BY i NULLS FIRST, j NULLS LAST LIMIT 2;
|
|
|
|
SELECT * FROM test ORDER BY i NULLS LAST, j NULLS LAST LIMIT 2;
|
|
|
|
SELECT * FROM test ORDER BY i;
|
|
|
|
SELECT * FROM test ORDER BY i NULLS FIRST;
|
|
|
|
SELECT * FROM test ORDER BY i NULLS LAST;
|
|
|
|
DROP TABLE test;
|