Files
greptimedb/tests/cases/standalone/common/select/multi_column_ref.result
dennis zhuang 24e5c9f6da test: migrate duckdb tests, part 1 (#6870)
* test: migrate duckdb tests

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix: style

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* test: add more duckdb tests

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix: stable order

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* chore: simplfy comments

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* chore: remove tests/cases/standalone/common/DUCKDB_MIGRATION_GUIDE.md

* fix: incorrect_sql.sql

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix: integer flow test

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix: integer flow test

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* docs: add todo

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

---------

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
2025-09-05 06:10:14 +00:00

72 lines
1.2 KiB
Plaintext

-- Migrated from DuckDB test: test/sql/select/test_multi_column_reference.test
-- Description: Test multi column reference
-- Note: Adapted for GreptimeDB - focusing on schema.table.column references
-- Test schema -> table -> column reference
CREATE SCHEMA test;
Affected Rows: 1
CREATE TABLE test.tbl(col INTEGER, ts TIMESTAMP TIME INDEX);
Affected Rows: 0
INSERT INTO test.tbl VALUES (1, 1000), (2, 2000), (3, 3000);
Affected Rows: 3
-- Full qualified reference: schema.table.column
SELECT test.tbl.col FROM test.tbl ORDER BY col;
+-----+
| col |
+-----+
| 1 |
| 2 |
| 3 |
+-----+
-- Table qualified reference
SELECT tbl.col FROM test.tbl ORDER BY col;
+-----+
| col |
+-----+
| 1 |
| 2 |
| 3 |
+-----+
-- Simple column reference
SELECT col FROM test.tbl ORDER BY col;
+-----+
| col |
+-----+
| 1 |
| 2 |
| 3 |
+-----+
-- Test with table alias
SELECT t.col FROM test.tbl t ORDER BY col;
+-----+
| col |
+-----+
| 1 |
| 2 |
| 3 |
+-----+
-- Note: DuckDB's struct field access (t.t.t pattern) is not applicable to GreptimeDB
-- as GreptimeDB doesn't support ROW/STRUCT types in the same way
-- Clean up
DROP TABLE test.tbl;
Affected Rows: 0
DROP SCHEMA test;
Affected Rows: 0