Skip to content

Commit

Permalink
added end-to-end tests in analyze and assessment
Browse files Browse the repository at this point in the history
  • Loading branch information
priyanshi-yb committed Jan 2, 2025
1 parent b066843 commit 3c03d6c
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ CREATE TABLE sales (

-- cases for multi column list partition, to be reported during analyze-schema
CREATE TABLE test_1 (
id numeric NOT NULL,
id numeric NOT NULL REFERENCES sales_data(sales_id),
country_code varchar(3),
record_type varchar(5),
descriptions varchar(50),
Expand Down
14 changes: 12 additions & 2 deletions migtests/tests/analyze-schema/expected_issues.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@
"GH": "",
"MinimumVersionsFixedIn": null
},
{
"IssueType": "unsupported_features",
"ObjectType": "TABLE",
"ObjectName": "test_1",
"Reason": "Foreign key constraint references partitioned table",
"SqlStatement": "CREATE TABLE test_1 (\n\tid numeric NOT NULL REFERENCES sales_data(sales_id),\n\tcountry_code varchar(3),\n\trecord_type varchar(5),\n\tdescriptions varchar(50),\n\tPRIMARY KEY (id)\n) PARTITION BY LIST (country_code, record_type) ;",
"Suggestion": "Not workaround available ",
"GH": "",
"MinimumVersionsFixedIn": null
},
{
"IssueType": "unsupported_features",
"ObjectType": "MVIEW",
Expand Down Expand Up @@ -416,7 +426,7 @@
"ObjectType": "TABLE",
"ObjectName": "test_1",
"Reason": "cannot use \"list\" partition strategy with more than one column",
"SqlStatement": "CREATE TABLE test_1 (\n\tid numeric NOT NULL,\n\tcountry_code varchar(3),\n\trecord_type varchar(5),\n\tdescriptions varchar(50),\n\tPRIMARY KEY (id)\n) PARTITION BY LIST (country_code, record_type) ;",
"SqlStatement": "CREATE TABLE test_1 (\n\tid numeric NOT NULL REFERENCES sales_data(sales_id),\n\tcountry_code varchar(3),\n\trecord_type varchar(5),\n\tdescriptions varchar(50),\n\tPRIMARY KEY (id)\n) PARTITION BY LIST (country_code, record_type) ;",
"DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/mysql/#multi-column-partition-by-list-is-not-supported",
"Suggestion": "Make it a single column partition by list or choose other supported Partitioning methods",
"GH": "https://github.com/yugabyte/yb-voyager/issues/699",
Expand Down Expand Up @@ -1465,7 +1475,7 @@
"ObjectType": "TABLE",
"ObjectName": "test_1",
"Reason": "insufficient columns in the PRIMARY KEY constraint definition in CREATE TABLE - (country_code, record_type)",
"SqlStatement": "CREATE TABLE test_1 (\n\tid numeric NOT NULL,\n\tcountry_code varchar(3),\n\trecord_type varchar(5),\n\tdescriptions varchar(50),\n\tPRIMARY KEY (id)\n) PARTITION BY LIST (country_code, record_type) ;",
"SqlStatement": "CREATE TABLE test_1 (\n\tid numeric NOT NULL REFERENCES sales_data(sales_id),\n\tcountry_code varchar(3),\n\trecord_type varchar(5),\n\tdescriptions varchar(50),\n\tPRIMARY KEY (id)\n) PARTITION BY LIST (country_code, record_type) ;",
"Suggestion": "Add all Partition columns to Primary Key",
"GH": "https://github.com/yugabyte/yb-voyager/issues/578",
"DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/oracle/#partition-key-column-not-part-of-primary-key-columns",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
{
"ObjectType": "TABLE",
"TotalCount": 82,
"InvalidCount": 35,
"InvalidCount": 36,
"ObjectNames": "public.employeesforview, schema2.employeesforview, public.\"Case_Sensitive_Columns\", public.\"Mixed_Case_Table_Name_Test\", public.\"Recipients\", public.\"WITH\", public.audit, public.bigint_multirange_table, public.boston, public.c, public.child_table, public.citext_type, public.combined_tbl, public.date_multirange_table, public.documents, public.employees, public.employees2, public.employees3, public.ext_test, public.foo, public.inet_type, public.int_multirange_table, public.library_nested, public.london, public.mixed_data_types_table1, public.mixed_data_types_table2, public.numeric_multirange_table, public.orders, public.orders2, public.orders_lateral, public.ordersentry, public.parent_table, public.products, public.sales_region, public.session_log, public.session_log1, public.session_log2, public.sydney, public.test_exclude_basic, public.test_jsonb, public.test_xml_type, public.timestamp_multirange_table, public.timestamptz_multirange_table, public.ts_query_table, public.tt, public.with_example1, public.with_example2, schema2.\"Case_Sensitive_Columns\", schema2.\"Mixed_Case_Table_Name_Test\", schema2.\"Recipients\", schema2.\"WITH\", schema2.audit, schema2.bigint_multirange_table, schema2.boston, schema2.c, schema2.child_table, schema2.date_multirange_table, schema2.employees2, schema2.ext_test, schema2.foo, schema2.int_multirange_table, schema2.london, schema2.mixed_data_types_table1, schema2.mixed_data_types_table2, schema2.numeric_multirange_table, schema2.orders, schema2.orders2, schema2.parent_table, schema2.products, schema2.sales_region, schema2.session_log, schema2.session_log1, schema2.session_log2, schema2.sydney, schema2.test_xml_type, schema2.timestamp_multirange_table, schema2.timestamptz_multirange_table, schema2.tt, schema2.with_example1, schema2.with_example2, test_views.view_table1, test_views.view_table2"
},
{
Expand Down Expand Up @@ -634,6 +634,16 @@
],
"MinimumVersionsFixedIn": null
},
{
"FeatureName": "Foreign key constraint references partitioned table",
"Objects": [
{
"ObjectName": "public.test_jsonb",
"SqlStatement": "ALTER TABLE ONLY public.test_jsonb\n ADD CONSTRAINT test_jsonb_id_region_fkey FOREIGN KEY (id, region) REFERENCES public.sales_region(id, region);"
}
],
"MinimumVersionsFixedIn": null
},
{
"FeatureName": "Regex Functions",
"Objects": [
Expand Down Expand Up @@ -1011,7 +1021,7 @@
"SchemaName": "public",
"ObjectName": "test_jsonb",
"RowCount": 0,
"ColumnCount": 3,
"ColumnCount": 4,
"Reads": 0,
"Writes": 0,
"ReadsPerSecond": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ WITH CHECK OPTION;
CREATE TABLE public.test_jsonb (
id integer,
data jsonb,
data2 text
data2 text,
region text,
FOREIGN KEY (id, region) REFERENCES sales_region(id, region)
);

CREATE TABLE public.inet_type (
Expand Down

0 comments on commit 3c03d6c

Please sign in to comment.