-
Notifications
You must be signed in to change notification settings - Fork 383
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#2034] Improvement (trino-connector): Add datatype , catalog test ca…
…ses for the Trino connector (#2036) ### What changes were proposed in this pull request? Add datatype , catalog test cases for the Trino connector ### Why are the changes needed? Issue: #2034 ### Does this PR introduce _any_ user-facing change? NO ### How was this patch tested? TriniQueryIT
- Loading branch information
Showing
21 changed files
with
748 additions
and
17 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
integration-test/src/test/resources/trino-ci-testset/testsets/hive/00006_datatype.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
CREATE SCHEMA "test.gt_hive".gt_db1; | ||
|
||
USE "test.gt_hive".gt_db1; | ||
|
||
-- Unsupported Type: TIME | ||
CREATE TABLE tb01 ( | ||
f1 VARCHAR(200), | ||
f2 CHAR(20), | ||
f3 VARBINARY, | ||
f4 DECIMAL(10, 3), | ||
f5 REAL, | ||
f6 DOUBLE, | ||
f7 BOOLEAN, | ||
f8 TINYINT, | ||
f9 SMALLINT, | ||
f10 INT, | ||
f11 INTEGER, | ||
f12 BIGINT, | ||
f13 DATE, | ||
f15 TIMESTAMP | ||
); | ||
|
||
SHOW CREATE TABLE tb01; | ||
|
||
INSERT INTO tb01 (f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f15) | ||
VALUES ('Sample text 1', 'Text1', x'65', 123.456, 7.89, 12.34, false, 1, 100, 1000, 1000, 100000, DATE '2024-01-01', TIMESTAMP '2024-01-01 08:00:00'); | ||
|
||
INSERT INTO tb01 (f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f15) | ||
VALUES (NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); | ||
|
||
select * from tb01 order by f1; | ||
|
||
drop table tb01; | ||
|
||
drop schema "test.gt_hive".gt_db1 cascade; |
42 changes: 42 additions & 0 deletions
42
integration-test/src/test/resources/trino-ci-testset/testsets/hive/00006_datatype.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
CREATE SCHEMA | ||
|
||
USE | ||
|
||
CREATE TABLE | ||
|
||
"CREATE TABLE ""test.gt_hive"".gt_db1.tb01 ( | ||
f1 varchar(200), | ||
f2 char(20), | ||
f3 varbinary, | ||
f4 decimal(10, 3), | ||
f5 real, | ||
f6 double, | ||
f7 boolean, | ||
f8 tinyint, | ||
f9 smallint, | ||
f10 integer, | ||
f11 integer, | ||
f12 bigint, | ||
f13 date, | ||
f15 timestamp(3) | ||
) | ||
COMMENT '' | ||
WITH ( | ||
input_format = 'org.apache.hadoop.mapred.TextInputFormat', | ||
location = 'hdfs://%:9000/user/hive/warehouse/gt_db1.db/tb01', | ||
output_format = 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat', | ||
serde_lib = 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe', | ||
serde_name = 'tb01', | ||
table_type = 'MANAGED_TABLE' | ||
)" | ||
|
||
INSERT: 1 row | ||
|
||
INSERT: 1 row | ||
|
||
"Sample text 1","Text1 ","65","123.456","7.89","12.34","false","1","100","1000","1000","100000","2024-01-01","2024-01-01 08:00:00.000" | ||
"","","","","","","","","","","","","","" | ||
|
||
DROP TABLE | ||
|
||
DROP SCHEMA |
55 changes: 52 additions & 3 deletions
55
...ation-test/src/test/resources/trino-ci-testset/testsets/jdbc-mysql/00000_create_table.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,61 @@ | ||
CREATE SCHEMA "test.gt_mysql".gt_db1; | ||
|
||
SHOW SCHEMAS FROM "test.gt_mysql" like 'gt_db1'; | ||
|
||
SHOW CREATE SCHEMA "test.gt_mysql".gt_db1; | ||
|
||
CREATE SCHEMA "test.gt_mysql".gt_db1; | ||
|
||
CREATE SCHEMA IF NOT EXISTS "test.gt_mysql".gt_db1; | ||
|
||
CREATE SCHEMA IF NOT EXISTS "test.gt_mysql".gt_db2; | ||
|
||
SHOW SCHEMAS FROM "test.gt_mysql" like 'gt_db2'; | ||
|
||
CREATE TABLE "test.gt_mysql".gt_db1.tb01 ( | ||
name varchar(200), | ||
salary int | ||
); | ||
|
||
show create table "test.gt_mysql".gt_db1.tb01; | ||
SHOW CREATE TABLE "test.gt_mysql".gt_db1.tb01; | ||
|
||
SHOW tables FROM "test.gt_mysql".gt_db1 like 'tb01'; | ||
|
||
CREATE TABLE "test.gt_mysql".gt_db1.tb01 ( | ||
name varchar(200), | ||
salary int | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS "test.gt_mysql".gt_db1.tb01 ( | ||
name varchar(200), | ||
salary int | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS "test.gt_mysql".gt_db1.tb02 ( | ||
name varchar(200), | ||
salary int | ||
); | ||
|
||
SHOW tables FROM "test.gt_mysql".gt_db1 like 'tb02'; | ||
|
||
DROP TABLE "test.gt_mysql".gt_db1.tb01; | ||
|
||
SHOW tables FROM "test.gt_mysql".gt_db1 like 'tb01'; | ||
|
||
DROP TABLE "test.gt_mysql".gt_db1.tb01; | ||
|
||
DROP TABLE IF EXISTS "test.gt_mysql".gt_db1.tb01; | ||
|
||
DROP TABLE IF EXISTS "test.gt_mysql".gt_db1.tb02; | ||
|
||
SHOW tables FROM "test.gt_mysql".gt_db1 like 'tb02'; | ||
|
||
DROP SCHEMA "test.gt_mysql".gt_db1; | ||
|
||
SHOW SCHEMAS FROM "test.gt_mysql" like 'gt_db1'; | ||
|
||
DROP SCHEMA IF EXISTS "test.gt_mysql".gt_db1; | ||
|
||
drop table "test.gt_mysql".gt_db1.tb01; | ||
DROP SCHEMA IF EXISTS "test.gt_mysql".gt_db2; | ||
|
||
drop schema "test.gt_mysql".gt_db1; | ||
SHOW SCHEMAS FROM "test.gt_mysql" like 'gt_db2' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.