From 2debf43edd6ba68cc2d6a70aebe89a180d4ed1b2 Mon Sep 17 00:00:00 2001 From: priyanshi-yb Date: Tue, 21 Jan 2025 15:17:18 +0530 Subject: [PATCH 01/19] run issues -integration tests with 2.25 --- .github/workflows/issue-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/issue-tests.yml b/.github/workflows/issue-tests.yml index 550eef3c8a..185818624d 100644 --- a/.github/workflows/issue-tests.yml +++ b/.github/workflows/issue-tests.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - version: [2.23.1.0-b220, 2024.1.3.1-b8, 2024.2.0.0-b145, 2.20.8.0-b53, 2.18.9.0-b17] + version: [2.23.1.0-b220, 2024.1.3.1-b8, 2024.2.0.0-b145, 2.20.8.0-b53, 2.18.9.0-b17, 2.25.0.0-b489] env: YB_VERSION: ${{ matrix.version }} YB_CONN_STR: "postgres://yugabyte:yugabyte@127.0.0.1:5433/yugabyte" From 898039697511c2efa96d7c5fb3623479abde2cd3 Mon Sep 17 00:00:00 2001 From: priyanshi-yb Date: Tue, 21 Jan 2025 17:58:04 +0530 Subject: [PATCH 02/19] add fixed in for the issues fixed in 2.25 --- yb-voyager/src/query/queryissue/issues_ddl.go | 20 ++++++++++++ .../src/query/queryissue/issues_ddl_test.go | 21 +++++++++++-- yb-voyager/src/query/queryissue/issues_dml.go | 7 +++++ .../src/query/queryissue/issues_dml_test.go | 31 ++++++++++++++++--- yb-voyager/src/ybversion/constants.go | 6 ++++ yb-voyager/src/ybversion/yb_version_test.go | 2 +- 6 files changed, 78 insertions(+), 9 deletions(-) diff --git a/yb-voyager/src/query/queryissue/issues_ddl.go b/yb-voyager/src/query/queryissue/issues_ddl.go index b3f49895ee..dbc0c3b2ce 100644 --- a/yb-voyager/src/query/queryissue/issues_ddl.go +++ b/yb-voyager/src/query/queryissue/issues_ddl.go @@ -33,6 +33,9 @@ var generatedColumnsIssue = issue.Issue{ GH: "https://github.com/yugabyte/yugabyte-db/issues/10695", Suggestion: "Using Triggers to update the generated columns is one way to work around this issue, refer docs link for more details.", DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#generated-always-as-stored-type-column-is-not-supported", + MinimumVersionsFixedIn: map[string]*ybversion.YBVersion{ + ybversion.SERIES_2_25: ybversion.V2_25_0_0, + }, } func NewGeneratedColumnsIssue(objectType string, objectName string, sqlStatement string, generatedColumns []string) QueryIssue { @@ -51,6 +54,7 @@ var unloggedTableIssue = issue.Issue{ DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#unlogged-table-is-not-supported", MinimumVersionsFixedIn: map[string]*ybversion.YBVersion{ ybversion.SERIES_2024_2: ybversion.V2024_2_0_0, + ybversion.SERIES_2_25: ybversion.V2_25_0_0, }, } @@ -264,6 +268,7 @@ var alterTableAddPKOnPartitionIssue = issue.Issue{ ybversion.SERIES_2024_1: ybversion.V2024_1_0_0, ybversion.SERIES_2024_2: ybversion.V2024_2_0_0, ybversion.SERIES_2_23: ybversion.V2_23_0_0, + ybversion.SERIES_2_25: ybversion.V2_25_0_0, }, } @@ -510,6 +515,9 @@ var multiRangeDatatypeIssue = issue.Issue{ Suggestion: "Multirange data type is not yet supported in YugabyteDB, no workaround available currently", GH: "https://github.com/yugabyte/yugabyte-db/issues/25575", DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", + MinimumVersionsFixedIn: map[string]*ybversion.YBVersion{ + ybversion.SERIES_2_25: ybversion.V2_25_0_0, + }, } func NewMultiRangeDatatypeIssue(objectType string, objectName string, sqlStatement string, typeName string, colName string) QueryIssue { @@ -526,6 +534,9 @@ var securityInvokerViewIssue = issue.Issue{ Suggestion: "Security Invoker Views are not yet supported in YugabyteDB, no workaround available currently", GH: "https://github.com/yugabyte/yugabyte-db/issues/25575", DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", + MinimumVersionsFixedIn: map[string]*ybversion.YBVersion{ + ybversion.SERIES_2_25: ybversion.V2_25_0_0, + }, } func NewSecurityInvokerViewIssue(objectType string, objectName string, SqlStatement string) QueryIssue { @@ -540,6 +551,9 @@ var deterministicOptionCollationIssue = issue.Issue{ Suggestion: "This feature is not supported in YugabyteDB yet", GH: "https://github.com/yugabyte/yugabyte-db/issues/25575", DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", + MinimumVersionsFixedIn: map[string]*ybversion.YBVersion{ + ybversion.SERIES_2_25: ybversion.V2_25_0_0, + }, } func NewDeterministicOptionCollationIssue(objectType string, objectName string, SqlStatement string) QueryIssue { @@ -554,6 +568,9 @@ var foreignKeyReferencesPartitionedTableIssue = issue.Issue{ Suggestion: "No workaround available ", GH: "https://github.com/yugabyte/yugabyte-db/issues/25575", DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", + MinimumVersionsFixedIn: map[string]*ybversion.YBVersion{ + ybversion.SERIES_2_25: ybversion.V2_25_0_0, + }, } func NewForeignKeyReferencesPartitionedTableIssue(objectType string, objectName string, SqlStatement string, constraintName string) QueryIssue { @@ -571,6 +588,9 @@ var uniqueNullsNotDistinctIssue = issue.Issue{ Suggestion: "", GH: "https://github.com/yugabyte/yugabyte-db/issues/25575", DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", + MinimumVersionsFixedIn: map[string]*ybversion.YBVersion{ + ybversion.SERIES_2_25: ybversion.V2_25_0_0, + }, } func NewUniqueNullsNotDistinctIssue(objectType string, objectName string, sqlStatement string) QueryIssue { diff --git a/yb-voyager/src/query/queryissue/issues_ddl_test.go b/yb-voyager/src/query/queryissue/issues_ddl_test.go index 01f90aa0fd..8e9aec9f64 100644 --- a/yb-voyager/src/query/queryissue/issues_ddl_test.go +++ b/yb-voyager/src/query/queryissue/issues_ddl_test.go @@ -67,6 +67,7 @@ func assertErrorCorrectlyThrownForIssueForYBVersion(t *testing.T, execErr error, if isFixed { assert.NoError(t, execErr) } else { + fmt.Printf("ERROR - %v", execErr) assert.ErrorContains(t, execErr, expectedError) } } @@ -141,7 +142,11 @@ func testSetAttributeIssue(t *testing.T) { stream_ordering bigint ); ALTER TABLE ONLY public.event_search ALTER COLUMN room_id SET (n_distinct=-0.01)`) - +/* + /home/runner/work/yb-voyager/yb-voyager/yb-voyager/src/query/queryissue/issues_ddl_test.go:145 + Error: Error "ERROR: ALTER action ALTER COLUMN ... SET not supported yet (SQLSTATE 0A000)" does not contain "ALTER TABLE ALTER column not supported yet" + Test: TestDDLIssuesInYBVersion/set_attribute-2.25.0.0-b489 +*/ assertErrorCorrectlyThrownForIssueForYBVersion(t, err, "ALTER TABLE ALTER column not supported yet", setColumnAttributeIssue) } @@ -161,7 +166,12 @@ func testClusterOnIssue(t *testing.T) { CREATE UNIQUE INDEX test_age_salary ON public.test USING btree (age ASC NULLS LAST, salary ASC NULLS LAST); ALTER TABLE public.test CLUSTER ON test_age_salary`) - +/* + /home/runner/work/yb-voyager/yb-voyager/yb-voyager/src/query/queryissue/issues_ddl_test.go:165 + Error: Error "ERROR: ALTER action CLUSTER ON not supported yet (SQLSTATE 0A000)" does not contain "ALTER TABLE CLUSTER not supported yet" + Test: TestDDLIssuesInYBVersion/cluster_on-2.25.0.0-b489 +=== NAME TestDDLIssuesInYBVersion +*/ assertErrorCorrectlyThrownForIssueForYBVersion(t, err, "ALTER TABLE CLUSTER not supported yet", alterTableClusterOnIssue) } @@ -177,7 +187,12 @@ func testDisableRuleIssue(t *testing.T) { create rule trule_rule as on update to trule do instead nothing; ALTER TABLE trule DISABLE RULE trule_rule`) - +/* + /home/runner/work/yb-voyager/yb-voyager/yb-voyager/src/query/queryissue/issues_ddl_test.go:181 + Error: Error "ERROR: ALTER action DISABLE RULE not supported yet (SQLSTATE 0A000)" does not contain "ALTER TABLE DISABLE RULE not supported yet" + Test: TestDDLIssuesInYBVersion/disable_rule-2.25.0.0-b489 +=== NAME TestDDLIssuesInYBVersion +*/ assertErrorCorrectlyThrownForIssueForYBVersion(t, err, "ALTER TABLE DISABLE RULE not supported yet", alterTableDisableRuleIssue) } diff --git a/yb-voyager/src/query/queryissue/issues_dml.go b/yb-voyager/src/query/queryissue/issues_dml.go index 8f15698d09..11f65c5a11 100644 --- a/yb-voyager/src/query/queryissue/issues_dml.go +++ b/yb-voyager/src/query/queryissue/issues_dml.go @@ -21,6 +21,7 @@ import ( "github.com/yugabyte/yb-voyager/yb-voyager/src/constants" "github.com/yugabyte/yb-voyager/yb-voyager/src/issue" + "github.com/yugabyte/yb-voyager/yb-voyager/src/ybversion" ) var advisoryLocksIssue = issue.Issue{ @@ -73,6 +74,9 @@ var regexFunctionsIssue = issue.Issue{ Suggestion: "", GH: "https://github.com/yugabyte/yugabyte-db/issues/25575", DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", + MinimumVersionsFixedIn: map[string]*ybversion.YBVersion{ + ybversion.SERIES_2_25: ybversion.V2_25_0_0, + }, } func NewRegexFunctionsIssue(objectType string, objectName string, sqlStatement string) QueryIssue { @@ -158,6 +162,9 @@ var jsonbSubscriptingIssue = issue.Issue{ Suggestion: "Use Arrow operators (-> / ->>) to access the jsonb fields.", GH: "https://github.com/yugabyte/yugabyte-db/issues/25575", DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#jsonb-subscripting", + MinimumVersionsFixedIn: map[string]*ybversion.YBVersion{ + ybversion.SERIES_2_25: ybversion.V2_25_0_0, + }, } func NewJsonbSubscriptingIssue(objectType string, objectName string, sqlStatement string) QueryIssue { diff --git a/yb-voyager/src/query/queryissue/issues_dml_test.go b/yb-voyager/src/query/queryissue/issues_dml_test.go index c18352fc75..4619488f5c 100644 --- a/yb-voyager/src/query/queryissue/issues_dml_test.go +++ b/yb-voyager/src/query/queryissue/issues_dml_test.go @@ -80,11 +80,20 @@ func testFetchWithTiesIssue(t *testing.T) { defer conn.Close(context.Background()) stmts := []string{ - `SELECT * FROM employees + `CREATE TABLE fetch_table(id int, salary bigint); + SELECT * FROM fetch_table ORDER BY salary DESC FETCH FIRST 2 ROWS WITH TIES;`, } + /* + r/yb-voyager/src/query/queryissue/issues_dml_test.go:90 + Error: Error "ERROR: column \"salary\" does not exist (SQLSTATE 42703)" does not contain "syntax error at or near \"WITH\"" + Test: TestDMLIssuesInYBVersion/fetch_with_ties-2.25.0.0-b489 + === NAME TestDMLIssuesInYBVersion + + */ + for _, stmt := range stmts { _, err = conn.Exec(ctx, stmt) assertErrorCorrectlyThrownForIssueForYBVersion(t, err, `syntax error at or near "WITH"`, regexFunctionsIssue) @@ -109,6 +118,11 @@ func testCopyFromWhereIssue(t *testing.T) { assert.NoError(t, err) defer conn.Close(context.Background()) + /* + Error: Error "ERROR: syntax error at or near \"WITH\" (SQLSTATE 42601)" does not contain "ERROR: syntax error at or near \"WHERE\" (SQLSTATE 42601)" + Test: TestDMLIssuesInYBVersion/copy_from_where-2.25.0.0-b489 + === NAME TestDMLIssuesInYBVersion + */ // In case the COPY FROM ... WHERE construct gets supported in the future, this test will fail with a different error message-something related to the data.csv file not being found. _, err = conn.Exec(ctx, `COPY pg_largeobject (loid, pageno, data) FROM '/path/to/data.csv' WHERE loid = 1 WITH (FORMAT csv, HEADER true);`) assertErrorCorrectlyThrownForIssueForYBVersion(t, err, "ERROR: syntax error at or near \"WHERE\" (SQLSTATE 42601)", copyFromWhereIssue) @@ -212,7 +226,14 @@ RETURNING merge_action(), w.*; for _, sql := range sqls { defer conn.Close(context.Background()) _, err = conn.Exec(ctx, sql) - + /* + /home/runner/work/yb-voyager/yb-voyager/yb-voyager/src/query/queryissue/issues_dml_test.go:216 + Error: Error "ERROR: This statement not supported yet (SQLSTATE 0A000)" does not contain "syntax error at or near \"MERGE\"" + Test: TestDMLIssuesInYBVersion/merge_statement-2.25.0.0-b489 + issues_ddl_test.go:70: + + */ + fmt.Printf("SQL - %s", sql) assertErrorCorrectlyThrownForIssueForYBVersion(t, err, `syntax error at or near "MERGE"`, mergeStatementIssue) } @@ -249,9 +270,9 @@ INSERT INTO events (event_range) VALUES ('[2024-01-20, 2024-01-25]'::daterange); SELECT range_agg(event_range) AS union_of_ranges -FROM events; +FROM events;`, -SELECT range_intersect_agg(event_range) AS intersection_of_ranges + `SELECT range_intersect_agg(event_range) AS intersection_of_ranges FROM events;`, } @@ -262,7 +283,7 @@ FROM events;`, defer conn.Close(context.Background()) _, err = conn.Exec(ctx, sql) - + fmt.Printf("SQL - %s", sql) assertErrorCorrectlyThrownForIssueForYBVersion(t, err, `does not exist`, aggregateFunctionIssue) } } diff --git a/yb-voyager/src/ybversion/constants.go b/yb-voyager/src/ybversion/constants.go index afa2c125f8..35431e39d2 100644 --- a/yb-voyager/src/ybversion/constants.go +++ b/yb-voyager/src/ybversion/constants.go @@ -34,6 +34,8 @@ var V2024_2_0_0 *YBVersion var V2_23_0_0 *YBVersion +var V2_25_0_0 *YBVersion + func init() { var err error V2024_1_0_0, err = NewYBVersion("2024.1.0.0") @@ -53,5 +55,9 @@ func init() { if err != nil { panic("could not create version 2.23.0.0") } + V2_25_0_0, err = NewYBVersion("2.25.0.0") + if err != nil { + panic("could not create version 2.25.0.0") + } LatestStable = V2024_2_0_0 } diff --git a/yb-voyager/src/ybversion/yb_version_test.go b/yb-voyager/src/ybversion/yb_version_test.go index e5e67b04ef..36b3411f4a 100644 --- a/yb-voyager/src/ybversion/yb_version_test.go +++ b/yb-voyager/src/ybversion/yb_version_test.go @@ -20,6 +20,7 @@ package ybversion import ( "encoding/json" + "fmt" "io" "net/http" "strings" @@ -109,7 +110,6 @@ func TestLatestStable(t *testing.T) { err = json.Unmarshal(body, &releases) assert.NoErrorf(t, err, "could not unmarshal response %q", string(body)) assert.NotEmpty(t, releases, "no releases found") - for _, r := range releases { // sample - v2.20.7.1 (Released October 16, 2024) releaseName := r.Name From e19a6a9a31cc392b5af5feb30988d1a09a2e2cdd Mon Sep 17 00:00:00 2001 From: priyanshi-yb Date: Wed, 22 Jan 2025 12:07:18 +0530 Subject: [PATCH 03/19] build --- yb-voyager/src/ybversion/yb_version_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/yb-voyager/src/ybversion/yb_version_test.go b/yb-voyager/src/ybversion/yb_version_test.go index 36b3411f4a..c06d75f754 100644 --- a/yb-voyager/src/ybversion/yb_version_test.go +++ b/yb-voyager/src/ybversion/yb_version_test.go @@ -20,7 +20,6 @@ package ybversion import ( "encoding/json" - "fmt" "io" "net/http" "strings" From abc733379425987d8f4abccb1a6854a394da320c Mon Sep 17 00:00:00 2001 From: priyanshi-yb Date: Wed, 22 Jan 2025 12:41:10 +0530 Subject: [PATCH 04/19] fix copy on where and on error test case and add versions to couple of more --- .../src/query/queryissue/issues_ddl_test.go | 1 - yb-voyager/src/query/queryissue/issues_dml.go | 6 ++ .../src/query/queryissue/issues_dml_test.go | 72 ++++++++++++++++--- 3 files changed, 68 insertions(+), 11 deletions(-) diff --git a/yb-voyager/src/query/queryissue/issues_ddl_test.go b/yb-voyager/src/query/queryissue/issues_ddl_test.go index 8e9aec9f64..c867c65dda 100644 --- a/yb-voyager/src/query/queryissue/issues_ddl_test.go +++ b/yb-voyager/src/query/queryissue/issues_ddl_test.go @@ -67,7 +67,6 @@ func assertErrorCorrectlyThrownForIssueForYBVersion(t *testing.T, execErr error, if isFixed { assert.NoError(t, execErr) } else { - fmt.Printf("ERROR - %v", execErr) assert.ErrorContains(t, execErr, expectedError) } } diff --git a/yb-voyager/src/query/queryissue/issues_dml.go b/yb-voyager/src/query/queryissue/issues_dml.go index 11f65c5a11..55b051c8ca 100644 --- a/yb-voyager/src/query/queryissue/issues_dml.go +++ b/yb-voyager/src/query/queryissue/issues_dml.go @@ -91,6 +91,9 @@ var aggregateFunctionIssue = issue.Issue{ Suggestion: "", GH: "https://github.com/yugabyte/yugabyte-db/issues/25575", DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", + MinimumVersionsFixedIn: map[string]*ybversion.YBVersion{ + ybversion.SERIES_2_25: ybversion.V2_25_0_0, + }, } func NewAggregationFunctionIssue(objectType string, objectName string, sqlStatement string, funcNames []string) QueryIssue { @@ -193,6 +196,9 @@ var copyFromWhereIssue = issue.Issue{ Suggestion: "", GH: "https://github.com/yugabyte/yugabyte-db/issues/25575", DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", + MinimumVersionsFixedIn: map[string]*ybversion.YBVersion{ + ybversion.SERIES_2_25: ybversion.V2_25_0_0, + }, } func NewCopyFromWhereIssue(objectType string, objectName string, sqlStatement string) QueryIssue { diff --git a/yb-voyager/src/query/queryissue/issues_dml_test.go b/yb-voyager/src/query/queryissue/issues_dml_test.go index 4619488f5c..3663fc3f2b 100644 --- a/yb-voyager/src/query/queryissue/issues_dml_test.go +++ b/yb-voyager/src/query/queryissue/issues_dml_test.go @@ -51,7 +51,7 @@ func testJsonbSubscriptingIssue(t *testing.T) { defer conn.Close(context.Background()) _, err = conn.Exec(ctx, `SELECT ('{"a": {"b": {"c": 1}}}'::jsonb)['a']['b']['c'];`) - assertErrorCorrectlyThrownForIssueForYBVersion(t, err, "cannot subscript type jsonb because it is not an array", loDatatypeIssue) + assertErrorCorrectlyThrownForIssueForYBVersion(t, err, "cannot subscript type jsonb because it is not an array", jsonbSubscriptingIssue) } func testRegexFunctionsIssue(t *testing.T) { @@ -105,10 +105,39 @@ func testCopyOnErrorIssue(t *testing.T) { conn, err := getConn() assert.NoError(t, err) + tmpFile, err := os.CreateTemp("/tmp", "copy_where_example.csv") + assert.NoError(t, err) + + // Write the csv content to the file + //4th row has error + csvData := `id,name,value +1,Item1,10 +2,Item2,20 +3,Item3,30 +4|Item4,40 +5,Item5,50 +6,Item6,60 +7,Item7,70 +8,Item8,80 +9,Item9,90 +10,Item10,100` + err = os.WriteFile(tmpFile.Name(), []byte(csvData), 0644) + assert.NoError(t, err) + + defer tmpFile.Close() + defer conn.Close(context.Background()) // In case the COPY ... ON_ERROR construct gets supported in the future, this test will fail with a different error message-something related to the data.csv file not being found. - _, err = conn.Exec(ctx, `COPY pg_largeobject (loid, pageno, data) FROM '/path/to/data.csv' WITH (FORMAT csv, HEADER true, ON_ERROR IGNORE);`) + _, err = conn.Exec(ctx, ` CREATE TABLE my_table_copy_error ( + id INT, + name TEXT, + value INT +); + + COPY my_table_copy_where (id, name, value) +FROM '/tmp/copy_where_example.csv' +WITH (FORMAT csv, HEADER true, ON_ERROR IGNORE)`) assertErrorCorrectlyThrownForIssueForYBVersion(t, err, "ERROR: option \"on_error\" not recognized (SQLSTATE 42601)", copyOnErrorIssue) } @@ -117,14 +146,38 @@ func testCopyFromWhereIssue(t *testing.T) { conn, err := getConn() assert.NoError(t, err) + tmpFile, err := os.CreateTemp("/tmp", "copy_where_example.csv") + assert.NoError(t, err) + + // Write the csv content to the file + csvData := `id,name,value +1,Item1,10 +2,Item2,20 +3,Item3,30 +4,Item4,40 +5,Item5,50 +6,Item6,60 +7,Item7,70 +8,Item8,80 +9,Item9,90 +10,Item10,100` + err = os.WriteFile(tmpFile.Name(), []byte(csvData), 0644) + assert.NoError(t, err) + + defer tmpFile.Close() + defer conn.Close(context.Background()) - /* - Error: Error "ERROR: syntax error at or near \"WITH\" (SQLSTATE 42601)" does not contain "ERROR: syntax error at or near \"WHERE\" (SQLSTATE 42601)" - Test: TestDMLIssuesInYBVersion/copy_from_where-2.25.0.0-b489 - === NAME TestDMLIssuesInYBVersion - */ - // In case the COPY FROM ... WHERE construct gets supported in the future, this test will fail with a different error message-something related to the data.csv file not being found. - _, err = conn.Exec(ctx, `COPY pg_largeobject (loid, pageno, data) FROM '/path/to/data.csv' WHERE loid = 1 WITH (FORMAT csv, HEADER true);`) + _, err = conn.Exec(ctx, ` + CREATE TABLE my_table_copy_where ( + id INT, + name TEXT, + value INT +); + + COPY my_table_copy_where (id, name, value) +FROM '/tmp/copy_where_example.csv' +WITH (FORMAT csv, HEADER true) +Where id <=5;`) assertErrorCorrectlyThrownForIssueForYBVersion(t, err, "ERROR: syntax error at or near \"WHERE\" (SQLSTATE 42601)", copyFromWhereIssue) } @@ -283,7 +336,6 @@ FROM events;`, defer conn.Close(context.Background()) _, err = conn.Exec(ctx, sql) - fmt.Printf("SQL - %s", sql) assertErrorCorrectlyThrownForIssueForYBVersion(t, err, `does not exist`, aggregateFunctionIssue) } } From cfc2e0520398aa6cdc916a10eb4b7485c2e9894c Mon Sep 17 00:00:00 2001 From: priyanshi-yb Date: Wed, 22 Jan 2025 13:19:10 +0530 Subject: [PATCH 05/19] separated out the any_value and range agg functions --- .../expectedAssessmentReport.json | 17 ++-- yb-voyager/cmd/assessMigrationCommand.go | 3 +- yb-voyager/src/query/queryissue/constants.go | 36 ++++---- yb-voyager/src/query/queryissue/detectors.go | 21 +++-- yb-voyager/src/query/queryissue/helpers.go | 8 +- yb-voyager/src/query/queryissue/issues_ddl.go | 3 - .../src/query/queryissue/issues_ddl_test.go | 2 +- yb-voyager/src/query/queryissue/issues_dml.go | 29 +++++-- .../src/query/queryissue/issues_dml_test.go | 85 +++++++++++-------- .../queryissue/parser_issue_detector_test.go | 10 +-- 10 files changed, 129 insertions(+), 85 deletions(-) diff --git a/migtests/tests/pg/assessment-report-test-uqc/expectedAssessmentReport.json b/migtests/tests/pg/assessment-report-test-uqc/expectedAssessmentReport.json index 29b451e198..c094b3f7fb 100644 --- a/migtests/tests/pg/assessment-report-test-uqc/expectedAssessmentReport.json +++ b/migtests/tests/pg/assessment-report-test-uqc/expectedAssessmentReport.json @@ -84,7 +84,7 @@ "UnsupportedDataTypesDesc": "Data types of the source database that are not supported on the target YugabyteDB.", "UnsupportedFeatures": [ { - "FeatureName": "Aggregate Functions", + "FeatureName": "Range aggregate Functions", "Objects": [ { "ObjectName": "sales.event_analysis_view", @@ -93,7 +93,14 @@ { "ObjectName": "sales.event_analysis_view2", "SqlStatement": "CREATE VIEW sales.event_analysis_view2 AS\n SELECT range_intersect_agg(event_range) AS overlapping_range\n FROM sales.events;" - }, + } + ], + "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", + "MinimumVersionsFixedIn": null + }, + { + "FeatureName": "ANY_VALUE() aggregate Function", + "Objects": [ { "ObjectName": "sales.employ_depart_view", "SqlStatement": "CREATE VIEW sales.employ_depart_view AS\n SELECT any_value(name) AS any_employee\n FROM public.employees;" @@ -236,19 +243,19 @@ "MinimumVersionsFixedIn": null }, { - "ConstructTypeName": "Aggregate Functions", + "ConstructTypeName": "Range aggregate Functions", "Query": "SELECT range_intersect_agg(event_range) AS intersection_of_ranges\nFROM sales.events", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", "MinimumVersionsFixedIn": null }, { - "ConstructTypeName": "Aggregate Functions", + "ConstructTypeName": "Range aggregate Functions", "Query": "SELECT range_agg(event_range) AS union_of_ranges\nFROM sales.events", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", "MinimumVersionsFixedIn": null }, { - "ConstructTypeName": "Aggregate Functions", + "ConstructTypeName": "ANY_VALUE() aggregate Function", "Query": "SELECT\n any_value(name) AS any_employee\n FROM employees", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", "MinimumVersionsFixedIn": null diff --git a/yb-voyager/cmd/assessMigrationCommand.go b/yb-voyager/cmd/assessMigrationCommand.go index 8a11962cb5..199a280c64 100644 --- a/yb-voyager/cmd/assessMigrationCommand.go +++ b/yb-voyager/cmd/assessMigrationCommand.go @@ -1064,7 +1064,8 @@ func fetchUnsupportedPGFeaturesFromSchemaReport(schemaAnalysisReport utils.Schem unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(FETCH_WITH_TIES_FEATURE, "", queryissue.FETCH_WITH_TIES, schemaAnalysisReport, false)) unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.JSON_QUERY_FUNCTIONS_NAME, "", queryissue.JSON_QUERY_FUNCTION, schemaAnalysisReport, false)) unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.JSON_CONSTRUCTOR_FUNCTION_NAME, "", queryissue.JSON_CONSTRUCTOR_FUNCTION, schemaAnalysisReport, false)) - unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.AGGREGATION_FUNCTIONS_NAME, "", queryissue.AGGREGATE_FUNCTION, schemaAnalysisReport, false)) + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.ANY_VALUE_AGGREGATE_FUNCTION_NAME, "", queryissue.ANY_VALUE_AGGREGATE_FUNCTION, schemaAnalysisReport, false)) + unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.RANGE_AGGREGATE_FUNCTION_NAME, "", queryissue.RANGE_AGGREGATE_FUNCTION, schemaAnalysisReport, false)) unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.SECURITY_INVOKER_VIEWS_NAME, "", queryissue.SECURITY_INVOKER_VIEWS, schemaAnalysisReport, false)) unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.DETERMINISTIC_OPTION_WITH_COLLATION_NAME, "", queryissue.DETERMINISTIC_OPTION_WITH_COLLATION, schemaAnalysisReport, false)) unsupportedFeatures = append(unsupportedFeatures, getUnsupportedFeaturesFromSchemaAnalysisReport(queryissue.UNIQUE_NULLS_NOT_DISTINCT_NAME, "", queryissue.UNIQUE_NULLS_NOT_DISTINCT, schemaAnalysisReport, false)) diff --git a/yb-voyager/src/query/queryissue/constants.go b/yb-voyager/src/query/queryissue/constants.go index 832258a530..5688e8421b 100644 --- a/yb-voyager/src/query/queryissue/constants.go +++ b/yb-voyager/src/query/queryissue/constants.go @@ -49,8 +49,11 @@ const ( FOREIGN_TABLE = "FOREIGN_TABLE" INHERITANCE = "INHERITANCE" - AGGREGATE_FUNCTION = "AGGREGATE_FUNCTION" - AGGREGATION_FUNCTIONS_NAME = "Aggregate Functions" + ANY_VALUE_AGGREGATE_FUNCTION = "ANY_VALUE_AGGREGATE_FUNCTION" + ANY_VALUE_AGGREGATE_FUNCTION_NAME = "ANY_VALUE() aggregate Function" + RANGE_AGGREGATE_FUNCTION = "RANGE_AGGREGATE_FUNCTION" + RANGE_AGGREGATE_FUNCTION_NAME = "Range aggregate Functions" + JSON_TYPE_PREDICATE = "JSON_TYPE_PREDICATE" JSON_TYPE_PREDICATE_NAME = "Json Type Predicate" JSON_CONSTRUCTOR_FUNCTION = "JSON_CONSTRUCTOR_FUNCTION" @@ -104,20 +107,21 @@ const ( // Note: Any issue description added here should be updated in reasonsIncludingSensitiveInformationToCallhome slice in analyzeSchema.go const ( // for DMLs - ADVISORY_LOCKS_ISSUE_DESCRIPTION = "Advisory locks are not yet implemented in YugabyteDB" - SYSTEM_COLUMNS_ISSUE_DESCRIPTION = "System columns are not yet supported in YugabyteDB" - XML_FUNCTIONS_ISSUE_DESCRIPTION = "XML functions are not yet supported in YugabyteDB" - REGEX_FUNCTIONS_ISSUE_DESCRIPTION = "Regex functions are not yet supported in YugabyteDB" - AGGREGATE_FUNCTION_ISSUE_DESCRIPTION = "any_value, range_agg and range_intersect_agg functions are not supported yet in YugabyteDB" - JSON_CONSTRUCTOR_FUNCTION_ISSUE_DESCRIPTION = "JSON constructor functions from PostgreSQL 17 are not yet supported in YugabyteDB" - JSON_QUERY_FUNCTION_ISSUE_DESCRIPTION = "JSON query functions from PostgreSQL 17 are not yet supported in YugabyteDB" - LO_FUNCTIONS_ISSUE_DESCRIPTION = "Large Objects functions are not supported in YugabyteDB" - JSONB_SUBSCRIPTING_ISSUE_DESCRIPTION = "Jsonb subscripting is not yet supported in YugabyteDB" - JSON_PREDICATE_ISSUE_DESCRIPTION = "IS JSON predicate expressions are not yet supported in YugabyteDB" - COPY_FROM_WHERE_ISSUE_DESCRIPTION = "COPY FROM ... WHERE is not yet supported in YugabyteDB" - COPY_ON_ERROR_ISSUE_DESCRIPTION = "COPY ... ON_ERROR is not yet supported in YugabyteDB" - FETCH_WITH_TIES_ISSUE_DESCRIPTION = "FETCH .. WITH TIES is not yet supported in YugabyteDB" - MERGE_STATEMENT_ISSUE_DESCRIPTION = "MERGE statement is not yet supported in YugabyteDB" + ADVISORY_LOCKS_ISSUE_DESCRIPTION = "Advisory locks are not yet implemented in YugabyteDB" + SYSTEM_COLUMNS_ISSUE_DESCRIPTION = "System columns are not yet supported in YugabyteDB" + XML_FUNCTIONS_ISSUE_DESCRIPTION = "XML functions are not yet supported in YugabyteDB" + REGEX_FUNCTIONS_ISSUE_DESCRIPTION = "Regex functions are not yet supported in YugabyteDB" + ANY_VALUE_AGGREGATE_FUNCTION_ISSUE_DESCRIPTION = "any_value function are not supported yet in YugabyteDB" + RANGE_AGGREGATE_FUNCTION_ISSUE_DESCRIPTION = "range_agg, range_intersect_agg function are not supported yet in YugabyteDB" + JSON_CONSTRUCTOR_FUNCTION_ISSUE_DESCRIPTION = "JSON constructor functions from PostgreSQL 17 are not yet supported in YugabyteDB" + JSON_QUERY_FUNCTION_ISSUE_DESCRIPTION = "JSON query functions from PostgreSQL 17 are not yet supported in YugabyteDB" + LO_FUNCTIONS_ISSUE_DESCRIPTION = "Large Objects functions are not supported in YugabyteDB" + JSONB_SUBSCRIPTING_ISSUE_DESCRIPTION = "Jsonb subscripting is not yet supported in YugabyteDB" + JSON_PREDICATE_ISSUE_DESCRIPTION = "IS JSON predicate expressions are not yet supported in YugabyteDB" + COPY_FROM_WHERE_ISSUE_DESCRIPTION = "COPY FROM ... WHERE is not yet supported in YugabyteDB" + COPY_ON_ERROR_ISSUE_DESCRIPTION = "COPY ... ON_ERROR is not yet supported in YugabyteDB" + FETCH_WITH_TIES_ISSUE_DESCRIPTION = "FETCH .. WITH TIES is not yet supported in YugabyteDB" + MERGE_STATEMENT_ISSUE_DESCRIPTION = "MERGE statement is not yet supported in YugabyteDB" // for DDLs STORED_GENERATED_COLUMNS_ISSUE_DESCRIPTION = "Stored generated columns are not supported in YugabyteDB. Detected columns are (%s)." diff --git a/yb-voyager/src/query/queryissue/detectors.go b/yb-voyager/src/query/queryissue/detectors.go index c62f473edb..5fdeb550b6 100644 --- a/yb-voyager/src/query/queryissue/detectors.go +++ b/yb-voyager/src/query/queryissue/detectors.go @@ -37,9 +37,10 @@ type FuncCallDetector struct { advisoryLocksFuncsDetected mapset.Set[string] xmlFuncsDetected mapset.Set[string] - aggFuncsDetected mapset.Set[string] + rangeAggFuncsDetected mapset.Set[string] regexFuncsDetected mapset.Set[string] loFuncsDetected mapset.Set[string] + anyValueFuncDetected bool } func NewFuncCallDetector(query string) *FuncCallDetector { @@ -47,7 +48,7 @@ func NewFuncCallDetector(query string) *FuncCallDetector { query: query, advisoryLocksFuncsDetected: mapset.NewThreadUnsafeSet[string](), xmlFuncsDetected: mapset.NewThreadUnsafeSet[string](), - aggFuncsDetected: mapset.NewThreadUnsafeSet[string](), + rangeAggFuncsDetected: mapset.NewThreadUnsafeSet[string](), regexFuncsDetected: mapset.NewThreadUnsafeSet[string](), loFuncsDetected: mapset.NewThreadUnsafeSet[string](), } @@ -72,9 +73,14 @@ func (d *FuncCallDetector) Detect(msg protoreflect.Message) error { d.regexFuncsDetected.Add(funcName) } - if unsupportedAggFunctions.ContainsOne(funcName) { - d.aggFuncsDetected.Add(funcName) + if unsupportedRangeAggFunctions.ContainsOne(funcName) { + d.rangeAggFuncsDetected.Add(funcName) } + + if funcName == ANY_VALUE { + d.anyValueFuncDetected = true + } + if unsupportedLargeObjectFunctions.ContainsOne(funcName) { d.loFuncsDetected.Add(funcName) } @@ -90,8 +96,11 @@ func (d *FuncCallDetector) GetIssues() []QueryIssue { if d.xmlFuncsDetected.Cardinality() > 0 { issues = append(issues, NewXmlFunctionsIssue(DML_QUERY_OBJECT_TYPE, "", d.query)) } - if d.aggFuncsDetected.Cardinality() > 0 { - issues = append(issues, NewAggregationFunctionIssue(DML_QUERY_OBJECT_TYPE, "", d.query, d.aggFuncsDetected.ToSlice())) + if d.rangeAggFuncsDetected.Cardinality() > 0 { + issues = append(issues, NewRangeAggregateFunctionIssue(DML_QUERY_OBJECT_TYPE, "", d.query, d.rangeAggFuncsDetected.ToSlice())) + } + if d.anyValueFuncDetected { + issues = append(issues, NewAnyValueAggregateFunctionIssue(DML_QUERY_OBJECT_TYPE, "", d.query)) } if d.regexFuncsDetected.Cardinality() > 0 { issues = append(issues, NewRegexFunctionsIssue(DML_QUERY_OBJECT_TYPE, "", d.query)) diff --git a/yb-voyager/src/query/queryissue/helpers.go b/yb-voyager/src/query/queryissue/helpers.go index dfc89f1197..d28ef94548 100644 --- a/yb-voyager/src/query/queryissue/helpers.go +++ b/yb-voyager/src/query/queryissue/helpers.go @@ -102,12 +102,14 @@ var UnsupportedIndexDatatypes = []string{ // array as well but no need to add it in the list as fetching this type is a different way TODO: handle better with specific types } -var unsupportedAggFunctions = mapset.NewThreadUnsafeSet([]string{ - //agg function added in PG16 - https://www.postgresql.org/docs/16/functions-aggregate.html#id-1.5.8.27.5.2.4.1.1.1.1 - "any_value", "range_agg", "range_intersect_agg", +var unsupportedRangeAggFunctions = mapset.NewThreadUnsafeSet([]string{ + //range agg function added in PG15 - https://www.postgresql.org/docs/15/functions-aggregate.html#:~:text=Yes-,range_agg,-(%20value%20anyrange + "range_agg", "range_intersect_agg", }...) const ( + ANY_VALUE = "any_value" //any_value function is added in PG16 - https://www.postgresql.org/docs/16/functions-aggregate.html#id-1.5.8.27.5.2.4.1.1.1.1 + // // json functions, refer - https://www.postgresql.org/about/featurematrix/detail/395/ JSON_OBJECTAGG = "JSON_OBJECTAGG" JSON_ARRAY = "JSON_ARRAY" diff --git a/yb-voyager/src/query/queryissue/issues_ddl.go b/yb-voyager/src/query/queryissue/issues_ddl.go index dbc0c3b2ce..dfac9ba391 100644 --- a/yb-voyager/src/query/queryissue/issues_ddl.go +++ b/yb-voyager/src/query/queryissue/issues_ddl.go @@ -551,9 +551,6 @@ var deterministicOptionCollationIssue = issue.Issue{ Suggestion: "This feature is not supported in YugabyteDB yet", GH: "https://github.com/yugabyte/yugabyte-db/issues/25575", DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", - MinimumVersionsFixedIn: map[string]*ybversion.YBVersion{ - ybversion.SERIES_2_25: ybversion.V2_25_0_0, - }, } func NewDeterministicOptionCollationIssue(objectType string, objectName string, SqlStatement string) QueryIssue { diff --git a/yb-voyager/src/query/queryissue/issues_ddl_test.go b/yb-voyager/src/query/queryissue/issues_ddl_test.go index c867c65dda..6136493120 100644 --- a/yb-voyager/src/query/queryissue/issues_ddl_test.go +++ b/yb-voyager/src/query/queryissue/issues_ddl_test.go @@ -297,7 +297,7 @@ func testDeterministicCollationIssue(t *testing.T) { _, err = conn.Exec(ctx, ` CREATE COLLATION case_insensitive (provider = icu, locale = 'und-u-ks-level2', deterministic = false);`) - assertErrorCorrectlyThrownForIssueForYBVersion(t, err, `collation attribute "deterministic" not recognized`, securityInvokerViewIssue) + assertErrorCorrectlyThrownForIssueForYBVersion(t, err, `collation attribute "deterministic" not recognized`, deterministicOptionCollationIssue) } func testForeignKeyReferencesPartitionedTableIssue(t *testing.T) { diff --git a/yb-voyager/src/query/queryissue/issues_dml.go b/yb-voyager/src/query/queryissue/issues_dml.go index 55b051c8ca..472ba6398e 100644 --- a/yb-voyager/src/query/queryissue/issues_dml.go +++ b/yb-voyager/src/query/queryissue/issues_dml.go @@ -83,25 +83,36 @@ func NewRegexFunctionsIssue(objectType string, objectName string, sqlStatement s return newQueryIssue(regexFunctionsIssue, objectType, objectName, sqlStatement, map[string]interface{}{}) } -var aggregateFunctionIssue = issue.Issue{ - Type: AGGREGATE_FUNCTION, - Name: AGGREGATION_FUNCTIONS_NAME, +var anyValueAggregateFunction = issue.Issue{ + Type: ANY_VALUE_AGGREGATE_FUNCTION, + Name: ANY_VALUE_AGGREGATE_FUNCTION_NAME, Impact: constants.IMPACT_LEVEL_2, - Description: AGGREGATE_FUNCTION_ISSUE_DESCRIPTION, + Description: ANY_VALUE_AGGREGATE_FUNCTION_ISSUE_DESCRIPTION, + Suggestion: "", + GH: "https://github.com/yugabyte/yugabyte-db/issues/25575", + DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", +} + +func NewAnyValueAggregateFunctionIssue(objectType string, objectName string, sqlStatement string) QueryIssue { + return newQueryIssue(anyValueAggregateFunction, objectType, objectName, sqlStatement, map[string]interface{}{}) +} + +var rangeAggregateFunctionIssue = issue.Issue{ + Type: RANGE_AGGREGATE_FUNCTION, + Name: RANGE_AGGREGATE_FUNCTION_NAME, + Impact: constants.IMPACT_LEVEL_2, + Description: RANGE_AGGREGATE_FUNCTION_ISSUE_DESCRIPTION, Suggestion: "", GH: "https://github.com/yugabyte/yugabyte-db/issues/25575", DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", - MinimumVersionsFixedIn: map[string]*ybversion.YBVersion{ - ybversion.SERIES_2_25: ybversion.V2_25_0_0, - }, } -func NewAggregationFunctionIssue(objectType string, objectName string, sqlStatement string, funcNames []string) QueryIssue { +func NewRangeAggregateFunctionIssue(objectType string, objectName string, sqlStatement string, funcNames []string) QueryIssue { sort.Strings(funcNames) details := map[string]interface{}{ FUNCTION_NAMES: funcNames, //TODO USE it later when we start putting these in reports } - return newQueryIssue(aggregateFunctionIssue, objectType, objectName, sqlStatement, details) + return newQueryIssue(rangeAggregateFunctionIssue, objectType, objectName, sqlStatement, details) } var jsonConstructorFunctionsIssue = issue.Issue{ diff --git a/yb-voyager/src/query/queryissue/issues_dml_test.go b/yb-voyager/src/query/queryissue/issues_dml_test.go index 3663fc3f2b..a7c8a494c0 100644 --- a/yb-voyager/src/query/queryissue/issues_dml_test.go +++ b/yb-voyager/src/query/queryissue/issues_dml_test.go @@ -121,7 +121,7 @@ func testCopyOnErrorIssue(t *testing.T) { 8,Item8,80 9,Item9,90 10,Item10,100` - err = os.WriteFile(tmpFile.Name(), []byte(csvData), 0644) + err = os.WriteFile(tmpFile.Name(), []byte(csvData), 0644) assert.NoError(t, err) defer tmpFile.Close() @@ -129,15 +129,15 @@ func testCopyOnErrorIssue(t *testing.T) { defer conn.Close(context.Background()) // In case the COPY ... ON_ERROR construct gets supported in the future, this test will fail with a different error message-something related to the data.csv file not being found. - _, err = conn.Exec(ctx, ` CREATE TABLE my_table_copy_error ( - id INT, - name TEXT, - value INT -); - - COPY my_table_copy_where (id, name, value) -FROM '/tmp/copy_where_example.csv' -WITH (FORMAT csv, HEADER true, ON_ERROR IGNORE)`) + _, err = conn.Exec(ctx, fmt.Sprintf(` CREATE TABLE my_table_copy_error ( + id INT, + name TEXT, + value INT + ); + + COPY my_table_copy_error (id, name, value) + FROM '%s' + WITH (FORMAT csv, HEADER true, ON_ERROR IGNORE)`, tmpFile.Name())) assertErrorCorrectlyThrownForIssueForYBVersion(t, err, "ERROR: option \"on_error\" not recognized (SQLSTATE 42601)", copyOnErrorIssue) } @@ -161,13 +161,13 @@ func testCopyFromWhereIssue(t *testing.T) { 8,Item8,80 9,Item9,90 10,Item10,100` - err = os.WriteFile(tmpFile.Name(), []byte(csvData), 0644) + err = os.WriteFile(tmpFile.Name(), []byte(csvData), 0644) assert.NoError(t, err) defer tmpFile.Close() defer conn.Close(context.Background()) - _, err = conn.Exec(ctx, ` + _, err = conn.Exec(ctx, fmt.Sprintf(` CREATE TABLE my_table_copy_where ( id INT, name TEXT, @@ -175,9 +175,9 @@ func testCopyFromWhereIssue(t *testing.T) { ); COPY my_table_copy_where (id, name, value) -FROM '/tmp/copy_where_example.csv' +FROM '%s' WITH (FORMAT csv, HEADER true) -Where id <=5;`) +Where id <=5;`, tmpFile.Name())) assertErrorCorrectlyThrownForIssueForYBVersion(t, err, "ERROR: syntax error at or near \"WHERE\" (SQLSTATE 42601)", copyFromWhereIssue) } @@ -286,32 +286,13 @@ RETURNING merge_action(), w.*; issues_ddl_test.go:70: */ - fmt.Printf("SQL - %s", sql) assertErrorCorrectlyThrownForIssueForYBVersion(t, err, `syntax error at or near "MERGE"`, mergeStatementIssue) } } -func testAggFunctions(t *testing.T) { +func testRangeAggFunctionsIssue(t *testing.T) { sqls := []string{ - `CREATE TABLE any_value_ex ( - department TEXT, - employee_name TEXT, - salary NUMERIC -); - -INSERT INTO any_value_ex VALUES -('HR', 'Alice', 50000), -('HR', 'Bob', 55000), -('IT', 'Charlie', 60000), -('IT', 'Diana', 62000); - -SELECT - department, - any_value(employee_name) AS any_employee -FROM any_value_ex -GROUP BY department;`, - `CREATE TABLE events ( id SERIAL PRIMARY KEY, event_range daterange @@ -336,10 +317,39 @@ FROM events;`, defer conn.Close(context.Background()) _, err = conn.Exec(ctx, sql) - assertErrorCorrectlyThrownForIssueForYBVersion(t, err, `does not exist`, aggregateFunctionIssue) + assertErrorCorrectlyThrownForIssueForYBVersion(t, err, `does not exist`, rangeAggregateFunctionIssue) } } +func testAnyValueAggFunctions(t *testing.T) { + sql := `CREATE TABLE any_value_ex ( + department TEXT, + employee_name TEXT, + salary NUMERIC +); + +INSERT INTO any_value_ex VALUES +('HR', 'Alice', 50000), +('HR', 'Bob', 55000), +('IT', 'Charlie', 60000), +('IT', 'Diana', 62000); + +SELECT + department, + any_value(employee_name) AS any_employee +FROM any_value_ex +GROUP BY department;` + + ctx := context.Background() + conn, err := getConn() + assert.NoError(t, err) + + defer conn.Close(context.Background()) + _, err = conn.Exec(ctx, sql) + assertErrorCorrectlyThrownForIssueForYBVersion(t, err, `does not exist`, anyValueAggregateFunction) + +} + func TestDMLIssuesInYBVersion(t *testing.T) { var err error ybVersion := os.Getenv("YB_VERSION") @@ -390,7 +400,10 @@ func TestDMLIssuesInYBVersion(t *testing.T) { success = t.Run(fmt.Sprintf("%s-%s", "json subscripting", ybVersion), testJsonbSubscriptingIssue) assert.True(t, success) - success = t.Run(fmt.Sprintf("%s-%s", "aggregate functions", ybVersion), testAggFunctions) + success = t.Run(fmt.Sprintf("%s-%s", "aggregate functions", ybVersion), testAnyValueAggFunctions) + assert.True(t, success) + + success = t.Run(fmt.Sprintf("%s-%s", "aggregate functions", ybVersion), testRangeAggFunctionsIssue) assert.True(t, success) success = t.Run(fmt.Sprintf("%s-%s", "json type predicate", ybVersion), testJsonPredicateIssue) diff --git a/yb-voyager/src/query/queryissue/parser_issue_detector_test.go b/yb-voyager/src/query/queryissue/parser_issue_detector_test.go index 744abc25f8..14b724f36b 100644 --- a/yb-voyager/src/query/queryissue/parser_issue_detector_test.go +++ b/yb-voyager/src/query/queryissue/parser_issue_detector_test.go @@ -827,17 +827,17 @@ $$ LANGUAGE plpgsql;`, } aggregateSqls := map[string][]QueryIssue{ sqls[0]: []QueryIssue{ - NewAggregationFunctionIssue(DML_QUERY_OBJECT_TYPE, "", sqls[0], []string{"any_value"}), + NewAnyValueAggregateFunctionIssue(DML_QUERY_OBJECT_TYPE, "", sqls[0]), }, sqls[1]: []QueryIssue{ - NewAggregationFunctionIssue(DML_QUERY_OBJECT_TYPE, "", sqls[1], []string{"range_intersect_agg"}), + NewRangeAggregateFunctionIssue(DML_QUERY_OBJECT_TYPE, "", sqls[1], []string{"range_intersect_agg"}), }, sqls[2]: []QueryIssue{ - NewAggregationFunctionIssue(DML_QUERY_OBJECT_TYPE, "", sqls[2], []string{"range_agg"}), + NewRangeAggregateFunctionIssue(DML_QUERY_OBJECT_TYPE, "", sqls[2], []string{"range_agg"}), }, sqls[3]: []QueryIssue{ - NewAggregationFunctionIssue(DML_QUERY_OBJECT_TYPE, "", "SELECT range_agg(range_value) FROM ranges;", []string{"range_agg"}), - NewAggregationFunctionIssue(DML_QUERY_OBJECT_TYPE, "", sqls[0], []string{"any_value"}), + NewRangeAggregateFunctionIssue(DML_QUERY_OBJECT_TYPE, "", "SELECT range_agg(range_value) FROM ranges;", []string{"range_agg"}), + NewAnyValueAggregateFunctionIssue(DML_QUERY_OBJECT_TYPE, "", sqls[0]), }, } aggregateSqls[sqls[3]] = modifiedIssuesforPLPGSQL(aggregateSqls[sqls[3]], "FUNCTION", "aggregate_ranges") From a3b67f42c610d493136f95c5b97682f8c74d9348 Mon Sep 17 00:00:00 2001 From: priyanshi-yb Date: Wed, 22 Jan 2025 13:37:26 +0530 Subject: [PATCH 06/19] changed copy where case to match with error msg casing --- yb-voyager/src/query/queryissue/issues_dml_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yb-voyager/src/query/queryissue/issues_dml_test.go b/yb-voyager/src/query/queryissue/issues_dml_test.go index a7c8a494c0..2a3458ecba 100644 --- a/yb-voyager/src/query/queryissue/issues_dml_test.go +++ b/yb-voyager/src/query/queryissue/issues_dml_test.go @@ -177,7 +177,7 @@ func testCopyFromWhereIssue(t *testing.T) { COPY my_table_copy_where (id, name, value) FROM '%s' WITH (FORMAT csv, HEADER true) -Where id <=5;`, tmpFile.Name())) +WHERE id <=5;`, tmpFile.Name())) assertErrorCorrectlyThrownForIssueForYBVersion(t, err, "ERROR: syntax error at or near \"WHERE\" (SQLSTATE 42601)", copyFromWhereIssue) } From 17ad8cace342072eb1b098c81813716ea5c2b6ce Mon Sep 17 00:00:00 2001 From: priyanshi-yb Date: Wed, 22 Jan 2025 13:58:37 +0530 Subject: [PATCH 07/19] fixed a few more cases --- yb-voyager/src/query/queryissue/issues_ddl.go | 4 ++++ yb-voyager/src/query/queryissue/issues_ddl_test.go | 7 +++---- yb-voyager/src/query/queryissue/issues_dml.go | 3 +++ yb-voyager/src/query/queryissue/issues_dml_test.go | 4 ++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/yb-voyager/src/query/queryissue/issues_ddl.go b/yb-voyager/src/query/queryissue/issues_ddl.go index dfac9ba391..25ca9a9d41 100644 --- a/yb-voyager/src/query/queryissue/issues_ddl.go +++ b/yb-voyager/src/query/queryissue/issues_ddl.go @@ -551,6 +551,10 @@ var deterministicOptionCollationIssue = issue.Issue{ Suggestion: "This feature is not supported in YugabyteDB yet", GH: "https://github.com/yugabyte/yugabyte-db/issues/25575", DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", + MinimumVersionsFixedIn: map[string]*ybversion.YBVersion{ + ybversion.SERIES_2_25: ybversion.V2_25_0_0, // TODO: understand why docs says coming soon non-deterministic collation but the CREATE COLLAITON works on 2.25 + //https://docs.yugabyte.com/preview/develop/pg15-features/#:~:text=Consider%20strings%20to%20be%20equal%20even%20if%20they%20consist%20of%20different%20bytes%2C%20for%20example%2C%20case%2Dinsensitive%2C%20or%20accent%2Dinsensitive%20comparisons. + }, } func NewDeterministicOptionCollationIssue(objectType string, objectName string, SqlStatement string) QueryIssue { diff --git a/yb-voyager/src/query/queryissue/issues_ddl_test.go b/yb-voyager/src/query/queryissue/issues_ddl_test.go index 6136493120..9f7575ae47 100644 --- a/yb-voyager/src/query/queryissue/issues_ddl_test.go +++ b/yb-voyager/src/query/queryissue/issues_ddl_test.go @@ -78,7 +78,7 @@ func testXMLFunctionIssue(t *testing.T) { defer conn.Close(context.Background()) _, err = conn.Exec(ctx, "SELECT xmlconcat('', 'foo')") - assert.ErrorContains(t, err, "unsupported XML feature") + assertErrorCorrectlyThrownForIssueForYBVersion(t, err, "unsupported XML feature", xmlFunctionsIssue) } func testStoredGeneratedFunctionsIssue(t *testing.T) { @@ -94,7 +94,7 @@ func testStoredGeneratedFunctionsIssue(t *testing.T) { width NUMERIC NOT NULL, area NUMERIC GENERATED ALWAYS AS (length * width) STORED )`) - assert.ErrorContains(t, err, "syntax error") + assertErrorCorrectlyThrownForIssueForYBVersion(t, err, "syntax error", generatedColumnsIssue) } func testUnloggedTableIssue(t *testing.T) { @@ -319,8 +319,7 @@ func testUniqueNullsNotDistinctIssue(t *testing.T) { assert.NoError(t, err) defer conn.Close(context.Background()) - _, err = conn.Exec(ctx, ` - CREATE TABLE public.products ( + _, err = conn.Exec(ctx, `CREATE TABLE public.products ( id INTEGER PRIMARY KEY, product_name VARCHAR(100), serial_number TEXT, diff --git a/yb-voyager/src/query/queryissue/issues_dml.go b/yb-voyager/src/query/queryissue/issues_dml.go index 472ba6398e..c22d083c4a 100644 --- a/yb-voyager/src/query/queryissue/issues_dml.go +++ b/yb-voyager/src/query/queryissue/issues_dml.go @@ -105,6 +105,9 @@ var rangeAggregateFunctionIssue = issue.Issue{ Suggestion: "", GH: "https://github.com/yugabyte/yugabyte-db/issues/25575", DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", + MinimumVersionsFixedIn: map[string]*ybversion.YBVersion{ + ybversion.SERIES_2_25: ybversion.V2_25_0_0, + }, } func NewRangeAggregateFunctionIssue(objectType string, objectName string, sqlStatement string, funcNames []string) QueryIssue { diff --git a/yb-voyager/src/query/queryissue/issues_dml_test.go b/yb-voyager/src/query/queryissue/issues_dml_test.go index 2a3458ecba..a0d30bfd1a 100644 --- a/yb-voyager/src/query/queryissue/issues_dml_test.go +++ b/yb-voyager/src/query/queryissue/issues_dml_test.go @@ -400,10 +400,10 @@ func TestDMLIssuesInYBVersion(t *testing.T) { success = t.Run(fmt.Sprintf("%s-%s", "json subscripting", ybVersion), testJsonbSubscriptingIssue) assert.True(t, success) - success = t.Run(fmt.Sprintf("%s-%s", "aggregate functions", ybVersion), testAnyValueAggFunctions) + success = t.Run(fmt.Sprintf("%s-%s", "any-value aggregate functions", ybVersion), testAnyValueAggFunctions) assert.True(t, success) - success = t.Run(fmt.Sprintf("%s-%s", "aggregate functions", ybVersion), testRangeAggFunctionsIssue) + success = t.Run(fmt.Sprintf("%s-%s", "range aggregate functions", ybVersion), testRangeAggFunctionsIssue) assert.True(t, success) success = t.Run(fmt.Sprintf("%s-%s", "json type predicate", ybVersion), testJsonPredicateIssue) From 4f79e8d1179cea674c373b1d6bb1507def2f1d48 Mon Sep 17 00:00:00 2001 From: priyanshi-yb Date: Wed, 22 Jan 2025 14:13:33 +0530 Subject: [PATCH 08/19] fixed new cases --- yb-voyager/src/query/queryissue/issues_ddl.go | 3 +++ .../src/query/queryissue/issues_ddl_test.go | 2 +- yb-voyager/src/query/queryissue/issues_dml.go | 3 +++ .../src/query/queryissue/issues_dml_test.go | 16 +++++++--------- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/yb-voyager/src/query/queryissue/issues_ddl.go b/yb-voyager/src/query/queryissue/issues_ddl.go index 318f8280a1..4ef7d18518 100644 --- a/yb-voyager/src/query/queryissue/issues_ddl.go +++ b/yb-voyager/src/query/queryissue/issues_ddl.go @@ -589,6 +589,9 @@ var sqlBodyInFunctionIssue = issue.Issue{ Suggestion: "No workaround available", GH: "https://github.com/yugabyte/yugabyte-db/issues/25575", DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", + MinimumVersionsFixedIn: map[string]*ybversion.YBVersion{ + ybversion.SERIES_2_25: ybversion.V2_25_0_0, + }, } func NewSqlBodyInFunctionIssue(objectType string, objectName string, SqlStatement string) QueryIssue { diff --git a/yb-voyager/src/query/queryissue/issues_ddl_test.go b/yb-voyager/src/query/queryissue/issues_ddl_test.go index 991b2062d2..46f03714e3 100644 --- a/yb-voyager/src/query/queryissue/issues_ddl_test.go +++ b/yb-voyager/src/query/queryissue/issues_ddl_test.go @@ -319,7 +319,7 @@ func testSQLBodyInFunctionIssue(t *testing.T) { RETURNS text LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE RETURN repeat('*', n);`: `syntax error at or near "RETURN"`, - `CREATE OR REPLACE FUNCTION asterisks(n int) + `CREATE OR REPLACE FUNCTION asterisks1(n int) RETURNS SETOF text LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE BEGIN ATOMIC diff --git a/yb-voyager/src/query/queryissue/issues_dml.go b/yb-voyager/src/query/queryissue/issues_dml.go index 6de8ee18da..0c6c529de3 100644 --- a/yb-voyager/src/query/queryissue/issues_dml.go +++ b/yb-voyager/src/query/queryissue/issues_dml.go @@ -255,6 +255,9 @@ var cteWithMaterializedIssue = issue.Issue{ Suggestion: "No workaround available right now", GH: "https://github.com/yugabyte/yugabyte-db/issues/25575", DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", + MinimumVersionsFixedIn: map[string]*ybversion.YBVersion{ + ybversion.SERIES_2_25: ybversion.V2_25_0_0, //TODO: understand in NOT MATERIALIZED works as expected internally + }, } func NewCTEWithMaterializedIssue(objectType string, objectName string, sqlStatement string) QueryIssue { diff --git a/yb-voyager/src/query/queryissue/issues_dml_test.go b/yb-voyager/src/query/queryissue/issues_dml_test.go index 9a29318b1a..77cc450ab0 100644 --- a/yb-voyager/src/query/queryissue/issues_dml_test.go +++ b/yb-voyager/src/query/queryissue/issues_dml_test.go @@ -351,20 +351,18 @@ GROUP BY department;` } func testCTEWithMaterializedIssue(t *testing.T) { - sqls := map[string]string{`WITH w AS NOT MATERIALIZED ( + sqls := map[string]string{` + CREATE TABLE big_table(key text, ref text, c1 int, c2 int); + WITH w AS NOT MATERIALIZED ( SELECT * FROM big_table ) SELECT * FROM w AS w1 JOIN w AS w2 ON w1.key = w2.ref WHERE w2.key = 123;`: `syntax error at or near "NOT"`, - `WITH moved_rows AS MATERIALIZED ( - DELETE FROM products - WHERE - "date" >= '2010-10-01' AND - "date" < '2010-11-01' - RETURNING * + `WITH w AS MATERIALIZED ( + SELECT * FROM big_table ) - INSERT INTO products_log - SELECT * FROM moved_rows;`: `syntax error at or near "MATERIALIZED"`, + SELECT * FROM w AS w1 JOIN w AS w2 ON w1.key = w2.ref + WHERE w2.key = 123;`: `syntax error at or near "MATERIALIZED"`, } for sql, errMsg := range sqls { ctx := context.Background() From 769a038baa5b1ff97cd993c095c9ebd8931b323f Mon Sep 17 00:00:00 2001 From: priyanshi-yb Date: Wed, 22 Jan 2025 14:37:59 +0530 Subject: [PATCH 09/19] error msgs as per tdb version --- .../src/query/queryissue/issues_ddl_test.go | 51 +++++++++++-------- .../src/query/queryissue/issues_dml_test.go | 20 ++++---- 2 files changed, 39 insertions(+), 32 deletions(-) diff --git a/yb-voyager/src/query/queryissue/issues_ddl_test.go b/yb-voyager/src/query/queryissue/issues_ddl_test.go index 46f03714e3..a251bae32b 100644 --- a/yb-voyager/src/query/queryissue/issues_ddl_test.go +++ b/yb-voyager/src/query/queryissue/issues_ddl_test.go @@ -141,12 +141,15 @@ func testSetAttributeIssue(t *testing.T) { stream_ordering bigint ); ALTER TABLE ONLY public.event_search ALTER COLUMN room_id SET (n_distinct=-0.01)`) -/* - /home/runner/work/yb-voyager/yb-voyager/yb-voyager/src/query/queryissue/issues_ddl_test.go:145 - Error: Error "ERROR: ALTER action ALTER COLUMN ... SET not supported yet (SQLSTATE 0A000)" does not contain "ALTER TABLE ALTER column not supported yet" - Test: TestDDLIssuesInYBVersion/set_attribute-2.25.0.0-b489 -*/ - assertErrorCorrectlyThrownForIssueForYBVersion(t, err, "ALTER TABLE ALTER column not supported yet", setColumnAttributeIssue) + + var errMsg string + switch testYbVersion { + case ybversion.V2_25_0_0: + errMsg = `ALTER action ALTER COLUMN ... SET not supported yet` + default: + errMsg = "ALTER TABLE ALTER column not supported yet" + } + assertErrorCorrectlyThrownForIssueForYBVersion(t, err, errMsg, setColumnAttributeIssue) } func testClusterOnIssue(t *testing.T) { @@ -165,13 +168,15 @@ func testClusterOnIssue(t *testing.T) { CREATE UNIQUE INDEX test_age_salary ON public.test USING btree (age ASC NULLS LAST, salary ASC NULLS LAST); ALTER TABLE public.test CLUSTER ON test_age_salary`) -/* - /home/runner/work/yb-voyager/yb-voyager/yb-voyager/src/query/queryissue/issues_ddl_test.go:165 - Error: Error "ERROR: ALTER action CLUSTER ON not supported yet (SQLSTATE 0A000)" does not contain "ALTER TABLE CLUSTER not supported yet" - Test: TestDDLIssuesInYBVersion/cluster_on-2.25.0.0-b489 -=== NAME TestDDLIssuesInYBVersion -*/ - assertErrorCorrectlyThrownForIssueForYBVersion(t, err, "ALTER TABLE CLUSTER not supported yet", alterTableClusterOnIssue) + + var errMsg string + switch testYbVersion { + case ybversion.V2_25_0_0: + errMsg = "ALTER action CLUSTER ON not supported yet" + default: + errMsg = "ALTER TABLE CLUSTER not supported yet" + } + assertErrorCorrectlyThrownForIssueForYBVersion(t, err, errMsg, alterTableClusterOnIssue) } func testDisableRuleIssue(t *testing.T) { @@ -186,13 +191,15 @@ func testDisableRuleIssue(t *testing.T) { create rule trule_rule as on update to trule do instead nothing; ALTER TABLE trule DISABLE RULE trule_rule`) -/* - /home/runner/work/yb-voyager/yb-voyager/yb-voyager/src/query/queryissue/issues_ddl_test.go:181 - Error: Error "ERROR: ALTER action DISABLE RULE not supported yet (SQLSTATE 0A000)" does not contain "ALTER TABLE DISABLE RULE not supported yet" - Test: TestDDLIssuesInYBVersion/disable_rule-2.25.0.0-b489 -=== NAME TestDDLIssuesInYBVersion -*/ - assertErrorCorrectlyThrownForIssueForYBVersion(t, err, "ALTER TABLE DISABLE RULE not supported yet", alterTableDisableRuleIssue) + + var errMsg string + switch testYbVersion { + case ybversion.V2_25_0_0: + errMsg = "ALTER action DISABLE RULE not supported yet" + default: + errMsg = "ALTER TABLE DISABLE RULE not supported yet" + } + assertErrorCorrectlyThrownForIssueForYBVersion(t, err, errMsg, alterTableDisableRuleIssue) } func testStorageParameterIssue(t *testing.T) { @@ -333,7 +340,7 @@ END;`: `syntax error at or near "BEGIN"`, defer conn.Close(context.Background()) _, err = conn.Exec(ctx, sql) - + fmt.Printf("%s", sql) assertErrorCorrectlyThrownForIssueForYBVersion(t, err, errMsg, sqlBodyInFunctionIssue) } } @@ -421,7 +428,7 @@ func TestDDLIssuesInYBVersion(t *testing.T) { success = t.Run(fmt.Sprintf("%s-%s", "sql body in function", ybVersion), testSQLBodyInFunctionIssue) assert.True(t, success) - + success = t.Run(fmt.Sprintf("%s-%s", "unique nulls not distinct", ybVersion), testUniqueNullsNotDistinctIssue) assert.True(t, success) } diff --git a/yb-voyager/src/query/queryissue/issues_dml_test.go b/yb-voyager/src/query/queryissue/issues_dml_test.go index 77cc450ab0..f400e6ecc3 100644 --- a/yb-voyager/src/query/queryissue/issues_dml_test.go +++ b/yb-voyager/src/query/queryissue/issues_dml_test.go @@ -279,14 +279,14 @@ RETURNING merge_action(), w.*; for _, sql := range sqls { defer conn.Close(context.Background()) _, err = conn.Exec(ctx, sql) - /* - /home/runner/work/yb-voyager/yb-voyager/yb-voyager/src/query/queryissue/issues_dml_test.go:216 - Error: Error "ERROR: This statement not supported yet (SQLSTATE 0A000)" does not contain "syntax error at or near \"MERGE\"" - Test: TestDMLIssuesInYBVersion/merge_statement-2.25.0.0-b489 - issues_ddl_test.go:70: - - */ - assertErrorCorrectlyThrownForIssueForYBVersion(t, err, `syntax error at or near "MERGE"`, mergeStatementIssue) + var errMsg string + switch testYbVersion { + case ybversion.V2_25_0_0: + errMsg = "This statement not supported yet" + default: + errMsg = `syntax error at or near "MERGE"` + } + assertErrorCorrectlyThrownForIssueForYBVersion(t, err, errMsg, mergeStatementIssue) } } @@ -357,12 +357,12 @@ func testCTEWithMaterializedIssue(t *testing.T) { SELECT * FROM big_table ) SELECT * FROM w AS w1 JOIN w AS w2 ON w1.key = w2.ref - WHERE w2.key = 123;`: `syntax error at or near "NOT"`, + WHERE w2.key = ''123;`: `syntax error at or near "NOT"`, `WITH w AS MATERIALIZED ( SELECT * FROM big_table ) SELECT * FROM w AS w1 JOIN w AS w2 ON w1.key = w2.ref - WHERE w2.key = 123;`: `syntax error at or near "MATERIALIZED"`, + WHERE w2.key = '123';`: `syntax error at or near "MATERIALIZED"`, } for sql, errMsg := range sqls { ctx := context.Background() From ab4823369778e2640524d9196924e69de9ac36b3 Mon Sep 17 00:00:00 2001 From: priyanshi-yb Date: Wed, 22 Jan 2025 14:50:00 +0530 Subject: [PATCH 10/19] trial --- yb-voyager/src/query/queryissue/issues_ddl_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/yb-voyager/src/query/queryissue/issues_ddl_test.go b/yb-voyager/src/query/queryissue/issues_ddl_test.go index a251bae32b..7e8c5331cd 100644 --- a/yb-voyager/src/query/queryissue/issues_ddl_test.go +++ b/yb-voyager/src/query/queryissue/issues_ddl_test.go @@ -169,6 +169,7 @@ func testClusterOnIssue(t *testing.T) { ALTER TABLE public.test CLUSTER ON test_age_salary`) + fmt.Printf("%s", testYbVersion) var errMsg string switch testYbVersion { case ybversion.V2_25_0_0: From e22d126d1a2b940bdf4f361ae616c66574edcc0e Mon Sep 17 00:00:00 2001 From: priyanshi-yb Date: Wed, 22 Jan 2025 15:03:52 +0530 Subject: [PATCH 11/19] try --- yb-voyager/src/query/queryissue/issues_ddl_test.go | 6 +++--- yb-voyager/src/query/queryissue/issues_dml_test.go | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/yb-voyager/src/query/queryissue/issues_ddl_test.go b/yb-voyager/src/query/queryissue/issues_ddl_test.go index 7e8c5331cd..8544bd5161 100644 --- a/yb-voyager/src/query/queryissue/issues_ddl_test.go +++ b/yb-voyager/src/query/queryissue/issues_ddl_test.go @@ -169,14 +169,14 @@ func testClusterOnIssue(t *testing.T) { ALTER TABLE public.test CLUSTER ON test_age_salary`) - fmt.Printf("%s", testYbVersion) var errMsg string - switch testYbVersion { - case ybversion.V2_25_0_0: + switch testYbVersion.String() { + case ybversion.V2_25_0_0.String(): errMsg = "ALTER action CLUSTER ON not supported yet" default: errMsg = "ALTER TABLE CLUSTER not supported yet" } + fmt.Printf("version -%v, match - %v, errorMSG - %s", testYbVersion, testYbVersion.String() == ybversion.V2_25_0_0.String(), errMsg) assertErrorCorrectlyThrownForIssueForYBVersion(t, err, errMsg, alterTableClusterOnIssue) } diff --git a/yb-voyager/src/query/queryissue/issues_dml_test.go b/yb-voyager/src/query/queryissue/issues_dml_test.go index f400e6ecc3..2f06a5b2be 100644 --- a/yb-voyager/src/query/queryissue/issues_dml_test.go +++ b/yb-voyager/src/query/queryissue/issues_dml_test.go @@ -357,8 +357,9 @@ func testCTEWithMaterializedIssue(t *testing.T) { SELECT * FROM big_table ) SELECT * FROM w AS w1 JOIN w AS w2 ON w1.key = w2.ref - WHERE w2.key = ''123;`: `syntax error at or near "NOT"`, - `WITH w AS MATERIALIZED ( + WHERE w2.key = '123';`: `syntax error at or near "NOT"`, + `CREATE TABLE big_table(key text, ref text, c1 int, c2 int); + WITH w AS MATERIALIZED ( SELECT * FROM big_table ) SELECT * FROM w AS w1 JOIN w AS w2 ON w1.key = w2.ref From 72771d33cda0f87b1cfb6b12f67dd36e4c651201 Mon Sep 17 00:00:00 2001 From: priyanshi-yb Date: Wed, 22 Jan 2025 15:28:25 +0530 Subject: [PATCH 12/19] fix --- yb-voyager/src/query/queryissue/issues_ddl_test.go | 14 ++++++-------- yb-voyager/src/query/queryissue/issues_dml_test.go | 12 ++---------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/yb-voyager/src/query/queryissue/issues_ddl_test.go b/yb-voyager/src/query/queryissue/issues_ddl_test.go index 8544bd5161..937d339d67 100644 --- a/yb-voyager/src/query/queryissue/issues_ddl_test.go +++ b/yb-voyager/src/query/queryissue/issues_ddl_test.go @@ -143,8 +143,8 @@ func testSetAttributeIssue(t *testing.T) { ALTER TABLE ONLY public.event_search ALTER COLUMN room_id SET (n_distinct=-0.01)`) var errMsg string - switch testYbVersion { - case ybversion.V2_25_0_0: + switch { + case testYbVersion.Equal(ybversion.V2_25_0_0): errMsg = `ALTER action ALTER COLUMN ... SET not supported yet` default: errMsg = "ALTER TABLE ALTER column not supported yet" @@ -170,13 +170,12 @@ func testClusterOnIssue(t *testing.T) { ALTER TABLE public.test CLUSTER ON test_age_salary`) var errMsg string - switch testYbVersion.String() { - case ybversion.V2_25_0_0.String(): + switch { + case testYbVersion.Equal(ybversion.V2_25_0_0): errMsg = "ALTER action CLUSTER ON not supported yet" default: errMsg = "ALTER TABLE CLUSTER not supported yet" } - fmt.Printf("version -%v, match - %v, errorMSG - %s", testYbVersion, testYbVersion.String() == ybversion.V2_25_0_0.String(), errMsg) assertErrorCorrectlyThrownForIssueForYBVersion(t, err, errMsg, alterTableClusterOnIssue) } @@ -194,8 +193,8 @@ func testDisableRuleIssue(t *testing.T) { ALTER TABLE trule DISABLE RULE trule_rule`) var errMsg string - switch testYbVersion { - case ybversion.V2_25_0_0: + switch { + case testYbVersion.Equal(ybversion.V2_25_0_0): errMsg = "ALTER action DISABLE RULE not supported yet" default: errMsg = "ALTER TABLE DISABLE RULE not supported yet" @@ -341,7 +340,6 @@ END;`: `syntax error at or near "BEGIN"`, defer conn.Close(context.Background()) _, err = conn.Exec(ctx, sql) - fmt.Printf("%s", sql) assertErrorCorrectlyThrownForIssueForYBVersion(t, err, errMsg, sqlBodyInFunctionIssue) } } diff --git a/yb-voyager/src/query/queryissue/issues_dml_test.go b/yb-voyager/src/query/queryissue/issues_dml_test.go index 2f06a5b2be..592f35e988 100644 --- a/yb-voyager/src/query/queryissue/issues_dml_test.go +++ b/yb-voyager/src/query/queryissue/issues_dml_test.go @@ -86,14 +86,6 @@ func testFetchWithTiesIssue(t *testing.T) { FETCH FIRST 2 ROWS WITH TIES;`, } - /* - r/yb-voyager/src/query/queryissue/issues_dml_test.go:90 - Error: Error "ERROR: column \"salary\" does not exist (SQLSTATE 42703)" does not contain "syntax error at or near \"WITH\"" - Test: TestDMLIssuesInYBVersion/fetch_with_ties-2.25.0.0-b489 - === NAME TestDMLIssuesInYBVersion - - */ - for _, stmt := range stmts { _, err = conn.Exec(ctx, stmt) assertErrorCorrectlyThrownForIssueForYBVersion(t, err, `syntax error at or near "WITH"`, regexFunctionsIssue) @@ -280,8 +272,8 @@ RETURNING merge_action(), w.*; defer conn.Close(context.Background()) _, err = conn.Exec(ctx, sql) var errMsg string - switch testYbVersion { - case ybversion.V2_25_0_0: + switch { + case testYbVersion.Equal(ybversion.V2_25_0_0): errMsg = "This statement not supported yet" default: errMsg = `syntax error at or near "MERGE"` From 064f01bfd8579e423d980835187a1d0000eb81b3 Mon Sep 17 00:00:00 2001 From: priyanshi-yb Date: Wed, 22 Jan 2025 15:45:09 +0530 Subject: [PATCH 13/19] fix --- yb-voyager/src/query/queryissue/issues_dml_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/yb-voyager/src/query/queryissue/issues_dml_test.go b/yb-voyager/src/query/queryissue/issues_dml_test.go index 592f35e988..0c53562674 100644 --- a/yb-voyager/src/query/queryissue/issues_dml_test.go +++ b/yb-voyager/src/query/queryissue/issues_dml_test.go @@ -350,8 +350,7 @@ func testCTEWithMaterializedIssue(t *testing.T) { ) SELECT * FROM w AS w1 JOIN w AS w2 ON w1.key = w2.ref WHERE w2.key = '123';`: `syntax error at or near "NOT"`, - `CREATE TABLE big_table(key text, ref text, c1 int, c2 int); - WITH w AS MATERIALIZED ( + `WITH w AS MATERIALIZED ( SELECT * FROM big_table ) SELECT * FROM w AS w1 JOIN w AS w2 ON w1.key = w2.ref From 11844559fea84fda6c686f0c429f29b372ad2e6f Mon Sep 17 00:00:00 2001 From: priyanshi-yb Date: Wed, 22 Jan 2025 18:10:52 +0530 Subject: [PATCH 14/19] fixed in for issues_dml/issues_ddl --- .../tests/analyze-schema/expected_issues.json | 76 ++++++++++++++----- .../expectedAssessmentReport.json | 44 ++++++++--- .../expectedAssessmentReport.json | 32 ++++++-- .../expectedAssessmentReport.json | 4 +- .../expected_schema_analysis_report.json | 8 +- yb-voyager/cmd/assessMigrationCommand.go | 1 + yb-voyager/src/query/queryissue/issues_ddl.go | 8 +- 7 files changed, 128 insertions(+), 45 deletions(-) diff --git a/migtests/tests/analyze-schema/expected_issues.json b/migtests/tests/analyze-schema/expected_issues.json index 3d7c83fd39..d76d6bef03 100644 --- a/migtests/tests/analyze-schema/expected_issues.json +++ b/migtests/tests/analyze-schema/expected_issues.json @@ -106,7 +106,9 @@ "Suggestion": "No workaround available ", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25575", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "IssueType": "unsupported_features", @@ -128,7 +130,9 @@ "Suggestion": "This feature is not supported in YugabyteDB yet", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25575", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "IssueType": "unsupported_features", @@ -139,7 +143,9 @@ "Suggestion": "This feature is not supported in YugabyteDB yet", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25575", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "IssueType": "unsupported_features", @@ -779,7 +785,9 @@ "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#generated-always-as-stored-type-column-is-not-supported", "Suggestion": "Using Triggers to update the generated columns is one way to work around this issue, refer docs link for more details.", "GH": "https://github.com/yugabyte/yugabyte-db/issues/10695", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "IssueType": "unsupported_features", @@ -790,7 +798,9 @@ "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#generated-always-as-stored-type-column-is-not-supported", "Suggestion": "Using Triggers to update the generated columns is one way to work around this issue, refer docs link for more details.", "GH": "https://github.com/yugabyte/yugabyte-db/issues/10695", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "IssueType": "unsupported_features", @@ -1636,7 +1646,9 @@ "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#generated-always-as-stored-type-column-is-not-supported", "Suggestion": "Using Triggers to update the generated columns is one way to work around this issue, refer docs link for more details.", "GH": "https://github.com/yugabyte/yugabyte-db/issues/10695", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "IssueType": "migration_caveats", @@ -2043,7 +2055,9 @@ "Suggestion": "Multirange data type is not yet supported in YugabyteDB, no workaround available currently", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25575", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "IssueType": "unsupported_datatypes", @@ -2054,7 +2068,9 @@ "Suggestion": "Multirange data type is not yet supported in YugabyteDB, no workaround available currently", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25575", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "IssueType": "unsupported_datatypes", @@ -2065,7 +2081,9 @@ "Suggestion": "Multirange data type is not yet supported in YugabyteDB, no workaround available currently", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25575", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "IssueType": "unsupported_features", @@ -2076,7 +2094,9 @@ "Suggestion": "No workaround available", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25575", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "IssueType": "unsupported_features", @@ -2087,7 +2107,9 @@ "Suggestion": "No workaround available", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25575", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "IssueType": "unsupported_features", @@ -2098,7 +2120,9 @@ "Suggestion": "No workaround available", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25575", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "IssueType": "unsupported_datatypes", @@ -2109,7 +2133,9 @@ "Suggestion": "Multirange data type is not yet supported in YugabyteDB, no workaround available currently", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25575", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "IssueType": "unsupported_datatypes", @@ -2120,7 +2146,9 @@ "Suggestion": "Multirange data type is not yet supported in YugabyteDB, no workaround available currently", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25575", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "IssueType": "unsupported_datatypes", @@ -2131,7 +2159,9 @@ "Suggestion": "Multirange data type is not yet supported in YugabyteDB, no workaround available currently", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25575", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "IssueType": "unsupported_features", @@ -2142,7 +2172,9 @@ "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25575", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "IssueType": "unsupported_features", @@ -2153,7 +2185,9 @@ "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25575", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "IssueType": "unsupported_features", @@ -2164,7 +2198,9 @@ "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25575", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "IssueType": "unsupported_features", @@ -2175,7 +2211,9 @@ "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25575", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "IssueType": "migration_caveats", diff --git a/migtests/tests/pg/assessment-report-test-uqc/expectedAssessmentReport.json b/migtests/tests/pg/assessment-report-test-uqc/expectedAssessmentReport.json index eeed8662fc..36306fbb16 100644 --- a/migtests/tests/pg/assessment-report-test-uqc/expectedAssessmentReport.json +++ b/migtests/tests/pg/assessment-report-test-uqc/expectedAssessmentReport.json @@ -97,7 +97,9 @@ } ], "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "FeatureName": "ANY_VALUE() aggregate Function", @@ -119,7 +121,9 @@ } ], "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#jsonb-subscripting", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "FeatureName": "Json Type Predicate", @@ -261,13 +265,17 @@ "ConstructTypeName": "Range aggregate Functions", "Query": "SELECT range_intersect_agg(event_range) AS intersection_of_ranges\nFROM sales.events", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "ConstructTypeName": "Range aggregate Functions", "Query": "SELECT range_agg(event_range) AS union_of_ranges\nFROM sales.events", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "ConstructTypeName": "ANY_VALUE() aggregate Function", @@ -286,25 +294,33 @@ "ConstructTypeName": "Jsonb Subscripting", "Query": "SELECT \n data,\n data[$1] AS name, \n (data[$2]) as active\nFROM sales.test_json_chk", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#jsonb-subscripting", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "ConstructTypeName": "Jsonb Subscripting", "Query": "SELECT (sales.get_user_info($1))[$2] AS user_info", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#jsonb-subscripting", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "ConstructTypeName": "Jsonb Subscripting", "Query": "SELECT (jsonb_build_object($1, $2, $3, $4, $5, $6) || $7)[$8] AS json_obj", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#jsonb-subscripting", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "ConstructTypeName": "Jsonb Subscripting", "Query": "SELECT ($1 :: jsonb)[$2][$3] as b", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#jsonb-subscripting", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "ConstructTypeName": "Json Type Predicate", @@ -316,13 +332,17 @@ "ConstructTypeName": "CTE with MATERIALIZE clause", "Query": "WITH w AS NOT MATERIALIZED ( \n SELECT * FROM sales.big_table\n) \nSELECT * FROM w AS w1 JOIN w AS w2 ON w1.key = w2.ref\nWHERE w2.key = $1", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "ConstructTypeName": "CTE with MATERIALIZE clause", "Query": "WITH w AS MATERIALIZED ( \n SELECT * FROM sales.big_table\n) \nSELECT * FROM w AS w1 JOIN w AS w2 ON w1.key = w2.ref\nWHERE w2.key = $1", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } } ], "UnsupportedPlPgSqlObjects": [ @@ -336,7 +356,9 @@ } ], "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#jsonb-subscripting", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } } ] } \ No newline at end of file diff --git a/migtests/tests/pg/assessment-report-test/expectedAssessmentReport.json b/migtests/tests/pg/assessment-report-test/expectedAssessmentReport.json index 4583b9abbe..bdac0faf9f 100644 --- a/migtests/tests/pg/assessment-report-test/expectedAssessmentReport.json +++ b/migtests/tests/pg/assessment-report-test/expectedAssessmentReport.json @@ -464,7 +464,9 @@ } ], "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#generated-always-as-stored-type-column-is-not-supported", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "FeatureName": "BEFORE ROW triggers on Partitioned tables", @@ -524,7 +526,9 @@ } ], "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "FeatureName": "View with check option", @@ -621,7 +625,9 @@ } ], "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "FeatureName": "Primary / Unique key constraints on complex datatypes", @@ -695,7 +701,9 @@ } ], "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "FeatureName": "Regex Functions", @@ -706,7 +714,9 @@ } ], "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "FeatureName": "FETCH .. WITH TIES Clause", @@ -732,7 +742,9 @@ } ], "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "FeatureName": "Unique Nulls Not Distinct", @@ -771,7 +783,9 @@ } ], "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } } ], "UnsupportedFeaturesDesc": "Features of the source database that are not supported on the target YugabyteDB.", @@ -2902,7 +2916,9 @@ "ConstructTypeName": "COPY FROM ... WHERE", "Query": "COPY employeesCopyFromWhere (id, name, age)\nFROM STDIN WITH (FORMAT csv)\nWHERE age \u003e 30", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "ConstructTypeName": "COPY ... ON_ERROR", diff --git a/migtests/tests/pg/omnibus/expected_files/expectedAssessmentReport.json b/migtests/tests/pg/omnibus/expected_files/expectedAssessmentReport.json index 2a7d6f823f..868b876ea0 100755 --- a/migtests/tests/pg/omnibus/expected_files/expectedAssessmentReport.json +++ b/migtests/tests/pg/omnibus/expected_files/expectedAssessmentReport.json @@ -540,7 +540,9 @@ } ], "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#generated-always-as-stored-type-column-is-not-supported", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "FeatureName": "Conversion objects", diff --git a/migtests/tests/pg/omnibus/expected_files/expected_schema_analysis_report.json b/migtests/tests/pg/omnibus/expected_files/expected_schema_analysis_report.json index 8e9559ad8f..e58993d952 100755 --- a/migtests/tests/pg/omnibus/expected_files/expected_schema_analysis_report.json +++ b/migtests/tests/pg/omnibus/expected_files/expected_schema_analysis_report.json @@ -198,7 +198,9 @@ "Suggestion": "Using Triggers to update the generated columns is one way to work around this issue, refer docs link for more details.", "GH": "https://github.com/yugabyte/yugabyte-db/issues/10695", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#generated-always-as-stored-type-column-is-not-supported", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "IssueType": "unsupported_features", @@ -210,7 +212,9 @@ "Suggestion": "Using Triggers to update the generated columns is one way to work around this issue, refer docs link for more details.", "GH": "https://github.com/yugabyte/yugabyte-db/issues/10695", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#generated-always-as-stored-type-column-is-not-supported", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "IssueType": "unsupported_features", diff --git a/yb-voyager/cmd/assessMigrationCommand.go b/yb-voyager/cmd/assessMigrationCommand.go index 4341adeaa5..6c59a363cf 100644 --- a/yb-voyager/cmd/assessMigrationCommand.go +++ b/yb-voyager/cmd/assessMigrationCommand.go @@ -1244,6 +1244,7 @@ func fetchUnsupportedPlPgSQLObjects(schemaAnalysisReport utils.SchemaReport) []U DisplayDDL: true, DocsLink: docsLink, Objects: objects, + MinimumVersionsFixedIn: minVersionsFixedIn, } unsupportedPlpgSqlObjects = append(unsupportedPlpgSqlObjects, feature) } diff --git a/yb-voyager/src/query/queryissue/issues_ddl.go b/yb-voyager/src/query/queryissue/issues_ddl.go index 4ef7d18518..4394894762 100644 --- a/yb-voyager/src/query/queryissue/issues_ddl.go +++ b/yb-voyager/src/query/queryissue/issues_ddl.go @@ -552,7 +552,7 @@ var deterministicOptionCollationIssue = issue.Issue{ GH: "https://github.com/yugabyte/yugabyte-db/issues/25575", DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", MinimumVersionsFixedIn: map[string]*ybversion.YBVersion{ - ybversion.SERIES_2_25: ybversion.V2_25_0_0, // TODO: understand why docs says coming soon non-deterministic collation but the CREATE COLLAITON works on 2.25 + ybversion.SERIES_2_25: ybversion.V2_25_0_0, // TODO: understand why docs says coming soon non-deterministic collation but the CREATE COLLAITON works on 2.25 //https://docs.yugabyte.com/preview/develop/pg15-features/#:~:text=Consider%20strings%20to%20be%20equal%20even%20if%20they%20consist%20of%20different%20bytes%2C%20for%20example%2C%20case%2Dinsensitive%2C%20or%20accent%2Dinsensitive%20comparisons. }, } @@ -570,7 +570,7 @@ var foreignKeyReferencesPartitionedTableIssue = issue.Issue{ GH: "https://github.com/yugabyte/yugabyte-db/issues/25575", DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", MinimumVersionsFixedIn: map[string]*ybversion.YBVersion{ - ybversion.SERIES_2_25: ybversion.V2_25_0_0, + ybversion.SERIES_2_25: ybversion.V2_25_0_0, }, } @@ -590,7 +590,7 @@ var sqlBodyInFunctionIssue = issue.Issue{ GH: "https://github.com/yugabyte/yugabyte-db/issues/25575", DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", MinimumVersionsFixedIn: map[string]*ybversion.YBVersion{ - ybversion.SERIES_2_25: ybversion.V2_25_0_0, + ybversion.SERIES_2_25: ybversion.V2_25_0_0, }, } @@ -607,7 +607,7 @@ var uniqueNullsNotDistinctIssue = issue.Issue{ GH: "https://github.com/yugabyte/yugabyte-db/issues/25575", DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#postgresql-12-and-later-features", MinimumVersionsFixedIn: map[string]*ybversion.YBVersion{ - ybversion.SERIES_2_25: ybversion.V2_25_0_0, + ybversion.SERIES_2_25: ybversion.V2_25_0_0, }, } From 11fe8e0bd294b2a82c17043cccfcb9216143f0f1 Mon Sep 17 00:00:00 2001 From: priyanshi-yb Date: Wed, 22 Jan 2025 18:19:30 +0530 Subject: [PATCH 15/19] fixed before row trigger on partitioned table on 2.25 --- .../tests/analyze-schema/expected_issues.json | 4 ++- .../expectedAssessmentReport.json | 4 ++- yb-voyager/src/query/queryissue/issues_ddl.go | 4 +++ .../src/query/queryissue/issues_ddl_test.go | 36 +++++++++++++++++++ 4 files changed, 46 insertions(+), 2 deletions(-) diff --git a/migtests/tests/analyze-schema/expected_issues.json b/migtests/tests/analyze-schema/expected_issues.json index d76d6bef03..270b6e3e0a 100644 --- a/migtests/tests/analyze-schema/expected_issues.json +++ b/migtests/tests/analyze-schema/expected_issues.json @@ -732,7 +732,9 @@ "Suggestion": "Create the triggers on individual partitions.", "GH": "https://github.com/yugabyte/yugabyte-db/issues/24830", "DocsLink": "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#before-row-triggers-on-partitioned-tables", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "IssueType": "unsupported_features", diff --git a/migtests/tests/pg/assessment-report-test/expectedAssessmentReport.json b/migtests/tests/pg/assessment-report-test/expectedAssessmentReport.json index bdac0faf9f..6166e14b3d 100644 --- a/migtests/tests/pg/assessment-report-test/expectedAssessmentReport.json +++ b/migtests/tests/pg/assessment-report-test/expectedAssessmentReport.json @@ -477,7 +477,9 @@ } ], "DocsLink":"https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#before-row-triggers-on-partitioned-tables", - "MinimumVersionsFixedIn": null + "MinimumVersionsFixedIn": { + "2.25": "2.25.0.0" + } }, { "FeatureName": "Exclusion constraints", diff --git a/yb-voyager/src/query/queryissue/issues_ddl.go b/yb-voyager/src/query/queryissue/issues_ddl.go index 4394894762..77f70158d2 100644 --- a/yb-voyager/src/query/queryissue/issues_ddl.go +++ b/yb-voyager/src/query/queryissue/issues_ddl.go @@ -251,6 +251,10 @@ var beforeRowTriggerOnPartitionTableIssue = issue.Issue{ DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#before-row-triggers-on-partitioned-tables", GH: "https://github.com/yugabyte/yugabyte-db/issues/24830", Suggestion: "Create the triggers on individual partitions.", + + MinimumVersionsFixedIn: map[string]*ybversion.YBVersion{ + ybversion.SERIES_2_25: ybversion.V2_25_0_0, + }, } func NewBeforeRowOnPartitionTableIssue(objectType string, objectName string, sqlStatement string) QueryIssue { diff --git a/yb-voyager/src/query/queryissue/issues_ddl_test.go b/yb-voyager/src/query/queryissue/issues_ddl_test.go index 937d339d67..4d076d1378 100644 --- a/yb-voyager/src/query/queryissue/issues_ddl_test.go +++ b/yb-voyager/src/query/queryissue/issues_ddl_test.go @@ -360,6 +360,39 @@ func testUniqueNullsNotDistinctIssue(t *testing.T) { assertErrorCorrectlyThrownForIssueForYBVersion(t, err, "syntax error", uniqueNullsNotDistinctIssue) } +func testBeforeRowTriggerOnPartitionedTable(t *testing.T) { + ctx := context.Background() + conn, err := getConn() + assert.NoError(t, err) + + defer conn.Close(context.Background()) + _, err = conn.Exec(ctx, ` +CREATE TABLE sales_region (id int, amount int, branch text, region text, PRIMARY KEY(id, region)) PARTITION BY LIST (region); + +CREATE OR REPLACE FUNCTION public.check_sales_region() +RETURNS TRIGGER AS $$ +BEGIN + + IF NEW.amount < 0 THEN + RAISE EXCEPTION 'Amount cannot be negative'; + END IF; + + IF NEW.branch IS NULL OR NEW.branch = '' THEN + RAISE EXCEPTION 'Branch name cannot be null or empty'; + END IF; + + RETURN NEW; +END; +$$ LANGUAGE plpgsql; + +CREATE TRIGGER before_sales_region_insert_update +BEFORE INSERT OR UPDATE ON public.sales_region +FOR EACH ROW +EXECUTE FUNCTION public.check_sales_region();`) + + assertErrorCorrectlyThrownForIssueForYBVersion(t, err, `"sales_region" is a partitioned table`, beforeRowTriggerOnPartitionTableIssue) +} + func TestDDLIssuesInYBVersion(t *testing.T) { var err error ybVersion := os.Getenv("YB_VERSION") @@ -430,4 +463,7 @@ func TestDDLIssuesInYBVersion(t *testing.T) { success = t.Run(fmt.Sprintf("%s-%s", "unique nulls not distinct", ybVersion), testUniqueNullsNotDistinctIssue) assert.True(t, success) + + success = t.Run(fmt.Sprintf("%s-%s", "before row triggers on partitioned table", ybVersion), testBeforeRowTriggerOnPartitionedTable) + assert.True(t, success) } From fae1fd1ae43ffe5cc2061fd26da4342016248b44 Mon Sep 17 00:00:00 2001 From: priyanshi-yb Date: Wed, 22 Jan 2025 18:21:32 +0530 Subject: [PATCH 16/19] fix cte issue --- yb-voyager/src/query/queryissue/issues_dml_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yb-voyager/src/query/queryissue/issues_dml_test.go b/yb-voyager/src/query/queryissue/issues_dml_test.go index 0c53562674..b2db6033f8 100644 --- a/yb-voyager/src/query/queryissue/issues_dml_test.go +++ b/yb-voyager/src/query/queryissue/issues_dml_test.go @@ -350,8 +350,9 @@ func testCTEWithMaterializedIssue(t *testing.T) { ) SELECT * FROM w AS w1 JOIN w AS w2 ON w1.key = w2.ref WHERE w2.key = '123';`: `syntax error at or near "NOT"`, - `WITH w AS MATERIALIZED ( - SELECT * FROM big_table + `CREATE TABLE big_table1(key text, ref text, c1 int, c2 int); + WITH w AS MATERIALIZED ( + SELECT * FROM big_table1 ) SELECT * FROM w AS w1 JOIN w AS w2 ON w1.key = w2.ref WHERE w2.key = '123';`: `syntax error at or near "MATERIALIZED"`, From d8099f229f9ac7d7215f6d1a3aa492bc177a207c Mon Sep 17 00:00:00 2001 From: priyanshi-yb Date: Thu, 23 Jan 2025 13:18:03 +0530 Subject: [PATCH 17/19] review comment --- .../src/query/queryissue/issues_dml_test.go | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/yb-voyager/src/query/queryissue/issues_dml_test.go b/yb-voyager/src/query/queryissue/issues_dml_test.go index b2db6033f8..06d3d5137e 100644 --- a/yb-voyager/src/query/queryissue/issues_dml_test.go +++ b/yb-voyager/src/query/queryissue/issues_dml_test.go @@ -97,9 +97,6 @@ func testCopyOnErrorIssue(t *testing.T) { conn, err := getConn() assert.NoError(t, err) - tmpFile, err := os.CreateTemp("/tmp", "copy_where_example.csv") - assert.NoError(t, err) - // Write the csv content to the file //4th row has error csvData := `id,name,value @@ -113,10 +110,9 @@ func testCopyOnErrorIssue(t *testing.T) { 8,Item8,80 9,Item9,90 10,Item10,100` - err = os.WriteFile(tmpFile.Name(), []byte(csvData), 0644) - assert.NoError(t, err) - defer tmpFile.Close() + fileName, err := testutils.CreateTempFile("/tmp", csvData, "csv") + assert.NoError(t, err) defer conn.Close(context.Background()) @@ -129,7 +125,7 @@ func testCopyOnErrorIssue(t *testing.T) { COPY my_table_copy_error (id, name, value) FROM '%s' - WITH (FORMAT csv, HEADER true, ON_ERROR IGNORE)`, tmpFile.Name())) + WITH (FORMAT csv, HEADER true, ON_ERROR IGNORE)`, fileName)) assertErrorCorrectlyThrownForIssueForYBVersion(t, err, "ERROR: option \"on_error\" not recognized (SQLSTATE 42601)", copyOnErrorIssue) } @@ -138,9 +134,6 @@ func testCopyFromWhereIssue(t *testing.T) { conn, err := getConn() assert.NoError(t, err) - tmpFile, err := os.CreateTemp("/tmp", "copy_where_example.csv") - assert.NoError(t, err) - // Write the csv content to the file csvData := `id,name,value 1,Item1,10 @@ -153,10 +146,9 @@ func testCopyFromWhereIssue(t *testing.T) { 8,Item8,80 9,Item9,90 10,Item10,100` - err = os.WriteFile(tmpFile.Name(), []byte(csvData), 0644) - assert.NoError(t, err) - defer tmpFile.Close() + fileName, err := testutils.CreateTempFile("/tmp", csvData, "csv") + assert.NoError(t, err) defer conn.Close(context.Background()) _, err = conn.Exec(ctx, fmt.Sprintf(` @@ -169,7 +161,7 @@ func testCopyFromWhereIssue(t *testing.T) { COPY my_table_copy_where (id, name, value) FROM '%s' WITH (FORMAT csv, HEADER true) -WHERE id <=5;`, tmpFile.Name())) +WHERE id <=5;`, fileName)) assertErrorCorrectlyThrownForIssueForYBVersion(t, err, "ERROR: syntax error at or near \"WHERE\" (SQLSTATE 42601)", copyFromWhereIssue) } From 8c9791772f081d513c8a565c4ba3d9f464d6e330 Mon Sep 17 00:00:00 2001 From: priyanshi-yb Date: Thu, 23 Jan 2025 13:33:34 +0530 Subject: [PATCH 18/19] commit missed files --- yb-voyager/cmd/importDataFileBatchProducer_test.go | 3 ++- yb-voyager/test/utils/testutils.go | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/yb-voyager/cmd/importDataFileBatchProducer_test.go b/yb-voyager/cmd/importDataFileBatchProducer_test.go index c33ca04750..538b4e9e97 100644 --- a/yb-voyager/cmd/importDataFileBatchProducer_test.go +++ b/yb-voyager/cmd/importDataFileBatchProducer_test.go @@ -24,6 +24,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/stretchr/testify/assert" + "github.com/yugabyte/yb-voyager/yb-voyager/src/constants" "github.com/yugabyte/yb-voyager/yb-voyager/src/datafile" "github.com/yugabyte/yb-voyager/yb-voyager/src/datastore" @@ -74,7 +75,7 @@ func createFileAndTask(lexportDir string, fileContents string, ldataDir string, EscapeChar: '\\', NullString: "NULL", } - tempFile, err := testutils.CreateTempFile(ldataDir, fileContents) + tempFile, err := testutils.CreateTempFile(ldataDir, fileContents, dataFileDescriptor.FileFormat) if err != nil { return "", nil, err } diff --git a/yb-voyager/test/utils/testutils.go b/yb-voyager/test/utils/testutils.go index f8a3418ab0..1f81356900 100644 --- a/yb-voyager/test/utils/testutils.go +++ b/yb-voyager/test/utils/testutils.go @@ -13,6 +13,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/stretchr/testify/assert" + "github.com/yugabyte/yb-voyager/yb-voyager/src/utils/sqlname" ) @@ -407,9 +408,9 @@ func FatalIfError(t *testing.T, err error) { } } -func CreateTempFile(dir string, fileContents string) (string, error) { +func CreateTempFile(dir string, fileContents string, fileFormat string) (string, error) { // Create a temporary file - file, err := os.CreateTemp(dir, "temp-*.txt") + file, err := os.CreateTemp(dir, fmt.Sprintf("temp-*.%s", fileFormat)) if err != nil { return "", err } From 8bb03a5b672fa931561126d2c69790f81dfc6dd4 Mon Sep 17 00:00:00 2001 From: priyanshi-yb Date: Thu, 23 Jan 2025 14:48:55 +0530 Subject: [PATCH 19/19] add fullstop to the some descriptions --- .../tests/analyze-schema/expected_issues.json | 56 +++++++++---------- .../expected_schema_analysis_report.json | 16 +++--- yb-voyager/src/query/queryissue/constants.go | 30 +++++----- yb-voyager/src/query/queryissue/issues_dml.go | 2 +- 4 files changed, 52 insertions(+), 52 deletions(-) diff --git a/migtests/tests/analyze-schema/expected_issues.json b/migtests/tests/analyze-schema/expected_issues.json index a30df07d12..b253f82108 100644 --- a/migtests/tests/analyze-schema/expected_issues.json +++ b/migtests/tests/analyze-schema/expected_issues.json @@ -24,7 +24,7 @@ "IssueType": "unsupported_features", "ObjectType": "VIEW", "ObjectName": "public.my_films_view", - "Reason": "JSON query functions from PostgreSQL 17 are not yet supported in YugabyteDB", + "Reason": "JSON query functions from PostgreSQL 17 are not yet supported in YugabyteDB.", "SqlStatement": "CREATE VIEW public.my_films_view AS\nSELECT jt.* FROM\n my_films,\n JSON_TABLE ( js, '$.favorites[*]'\n COLUMNS (\n id FOR ORDINALITY,\n kind text PATH '$.kind',\n NESTED PATH '$.films[*]' COLUMNS (\n title text FORMAT JSON PATH '$.title' OMIT QUOTES,\n director text PATH '$.director' KEEP QUOTES))) AS jt;", "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25575", @@ -35,7 +35,7 @@ "IssueType": "unsupported_features", "ObjectType": "TABLE", "ObjectName": "public.json_data", - "Reason": "IS JSON predicate expressions are not yet supported in YugabyteDB", + "Reason": "IS JSON predicate expressions are not yet supported in YugabyteDB.", "SqlStatement": "CREATE TABLE public.json_data (\n id SERIAL PRIMARY KEY,\n data_column TEXT NOT NULL CHECK (data_column IS JSON)\n);", "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25575", @@ -46,7 +46,7 @@ "IssueType": "unsupported_features", "ObjectType": "TABLE", "ObjectName": "test_arr_enum", - "Reason": "IS JSON predicate expressions are not yet supported in YugabyteDB", + "Reason": "IS JSON predicate expressions are not yet supported in YugabyteDB.", "SqlStatement": "CREATE TABLE test_arr_enum (\n\tid int,\n\tarr text[],\n\tarr_enum enum_test[],\n object_column TEXT CHECK (object_column IS JSON OBJECT)\n);", "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25575", @@ -57,7 +57,7 @@ "IssueType": "unsupported_features", "ObjectType": "TABLE", "ObjectName": "test_udt", - "Reason": "IS JSON predicate expressions are not yet supported in YugabyteDB", + "Reason": "IS JSON predicate expressions are not yet supported in YugabyteDB.", "SqlStatement": "CREATE TABLE test_udt (\n\temployee_id SERIAL PRIMARY KEY,\n\temployee_name VARCHAR(100),\n\thome_address address_type,\n\tsome_field enum_test,\n\thome_address1 non_public.address_type1,\n scalar_column TEXT CHECK (scalar_column IS JSON SCALAR)\n);", "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25575", @@ -68,7 +68,7 @@ "IssueType": "unsupported_features", "ObjectType": "TABLE", "ObjectName": "public.xml_data_example", - "Reason": "IS JSON predicate expressions are not yet supported in YugabyteDB", + "Reason": "IS JSON predicate expressions are not yet supported in YugabyteDB.", "SqlStatement": " CREATE TABLE public.xml_data_example (\n id SERIAL PRIMARY KEY,\n name VARCHAR(255),\n description XML DEFAULT xmlparse(document '\u003cproduct\u003e\u003cname\u003eDefault Product\u003c/name\u003e\u003cprice\u003e100.00\u003c/price\u003e\u003ccategory\u003eElectronics\u003c/category\u003e\u003c/product\u003e'),\n created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,\n unique_keys_column TEXT CHECK (unique_keys_column IS JSON WITH UNIQUE KEYS)\n);", "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25575", @@ -79,7 +79,7 @@ "IssueType": "unsupported_features", "ObjectType": "TABLE", "ObjectName": "public.locations", - "Reason": "IS JSON predicate expressions are not yet supported in YugabyteDB", + "Reason": "IS JSON predicate expressions are not yet supported in YugabyteDB.", "SqlStatement": "CREATE TABLE public.locations (\n id integer NOT NULL,\n name character varying(100),\n geom geometry(Point,4326),\n array_column TEXT CHECK (array_column IS JSON ARRAY)\n );", "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25575", @@ -90,7 +90,7 @@ "IssueType": "unsupported_features", "ObjectType": "VIEW", "ObjectName": "test", - "Reason": "JSON constructor functions from PostgreSQL 17 are not yet supported in YugabyteDB", + "Reason": "JSON constructor functions from PostgreSQL 17 are not yet supported in YugabyteDB.", "SqlStatement": "CREATE OR REPLACE view test AS (\n select x , JSON_ARRAYAGG(trunc(b, 2) order by t desc) as agg\n FROM test1\n where t = '1DAY' group by x\n );", "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25575", @@ -114,7 +114,7 @@ "IssueType": "unsupported_features", "ObjectType": "MVIEW", "ObjectName": "test", - "Reason": "JSON constructor functions from PostgreSQL 17 are not yet supported in YugabyteDB", + "Reason": "JSON constructor functions from PostgreSQL 17 are not yet supported in YugabyteDB.", "SqlStatement": "CREATE MATERIALIZED VIEW test AS (\n select x , JSON_ARRAYAGG(trunc(b, 2) order by t desc) as agg\n FROM test1\n where t = '1DAY' group by x\n );", "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25575", @@ -151,7 +151,7 @@ "IssueType": "unsupported_features", "ObjectType": "TABLE", "ObjectName": "public.xml_data_example", - "Reason": "XML functions are not yet supported in YugabyteDB", + "Reason": "XML functions are not yet supported in YugabyteDB.", "SqlStatement": " CREATE TABLE public.xml_data_example (\n id SERIAL PRIMARY KEY,\n name VARCHAR(255),\n description XML DEFAULT xmlparse(document '\u003cproduct\u003e\u003cname\u003eDefault Product\u003c/name\u003e\u003cprice\u003e100.00\u003c/price\u003e\u003ccategory\u003eElectronics\u003c/category\u003e\u003c/product\u003e'),\n created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,\n unique_keys_column TEXT CHECK (unique_keys_column IS JSON WITH UNIQUE KEYS)\n);", "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/1043", @@ -1678,7 +1678,7 @@ "IssueType": "unsupported_plpgsql_objects", "ObjectType": "FUNCTION", "ObjectName": "create_and_populate_tables", - "Reason": "Advisory locks are not yet implemented in YugabyteDB", + "Reason": "Advisory locks are not yet implemented in YugabyteDB.", "SqlStatement": "SELECT pg_advisory_lock(sender_id);", "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/3642", @@ -1689,7 +1689,7 @@ "IssueType": "unsupported_plpgsql_objects", "ObjectType": "FUNCTION", "ObjectName": "create_and_populate_tables", - "Reason": "Advisory locks are not yet implemented in YugabyteDB", + "Reason": "Advisory locks are not yet implemented in YugabyteDB.", "SqlStatement": "SELECT pg_advisory_lock(receiver_id);", "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/3642", @@ -1700,7 +1700,7 @@ "IssueType": "unsupported_plpgsql_objects", "ObjectType": "FUNCTION", "ObjectName": "create_and_populate_tables", - "Reason": "Advisory locks are not yet implemented in YugabyteDB", + "Reason": "Advisory locks are not yet implemented in YugabyteDB.", "SqlStatement": "SELECT pg_advisory_unlock(sender_id);", "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/3642", @@ -1711,7 +1711,7 @@ "IssueType": "unsupported_plpgsql_objects", "ObjectType": "FUNCTION", "ObjectName": "create_and_populate_tables", - "Reason": "Advisory locks are not yet implemented in YugabyteDB", + "Reason": "Advisory locks are not yet implemented in YugabyteDB.", "SqlStatement": "SELECT pg_advisory_unlock(receiver_id);", "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/3642", @@ -1722,7 +1722,7 @@ "IssueType": "unsupported_plpgsql_objects", "ObjectType": "FUNCTION", "ObjectName": "create_and_populate_tables", - "Reason": "Advisory locks are not yet implemented in YugabyteDB", + "Reason": "Advisory locks are not yet implemented in YugabyteDB.", "SqlStatement": "SELECT pg_advisory_unlock(sender_id);", "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/3642", @@ -1733,7 +1733,7 @@ "IssueType": "unsupported_plpgsql_objects", "ObjectType": "FUNCTION", "ObjectName": "create_and_populate_tables", - "Reason": "Advisory locks are not yet implemented in YugabyteDB", + "Reason": "Advisory locks are not yet implemented in YugabyteDB.", "SqlStatement": "SELECT pg_advisory_unlock(receiver_id);", "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/3642", @@ -1744,7 +1744,7 @@ "IssueType": "unsupported_plpgsql_objects", "ObjectType": "FUNCTION", "ObjectName": "create_and_populate_tables", - "Reason": "XML functions are not yet supported in YugabyteDB", + "Reason": "XML functions are not yet supported in YugabyteDB.", "SqlStatement": "SELECT id, xpath('/person/name/text()', data) AS name FROM test_xml_type;", "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/1043", @@ -1755,7 +1755,7 @@ "IssueType": "unsupported_plpgsql_objects", "ObjectType": "FUNCTION", "ObjectName": "create_and_populate_tables", - "Reason": "System columns are not yet supported in YugabyteDB", + "Reason": "System columns are not yet supported in YugabyteDB.", "SqlStatement": "SELECT * FROM employees e WHERE e.xmax = (SELECT MAX(xmax) FROM employees WHERE department = e.department);", "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/24843", @@ -1766,7 +1766,7 @@ "IssueType": "unsupported_plpgsql_objects", "ObjectType": "PROCEDURE", "ObjectName": "add_employee", - "Reason": "Advisory locks are not yet implemented in YugabyteDB", + "Reason": "Advisory locks are not yet implemented in YugabyteDB.", "SqlStatement": "SELECT id, first_name FROM employees WHERE pg_try_advisory_lock(300) IS TRUE;", "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/3642", @@ -1777,7 +1777,7 @@ "IssueType": "unsupported_plpgsql_objects", "ObjectType": "PROCEDURE", "ObjectName": "add_employee", - "Reason": "System columns are not yet supported in YugabyteDB", + "Reason": "System columns are not yet supported in YugabyteDB.", "SqlStatement": "SELECT e.id, e.name,\n ROW_NUMBER() OVER (ORDER BY e.ctid) AS row_num\n FROM employees e;", "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/24843", @@ -1788,7 +1788,7 @@ "IssueType": "unsupported_plpgsql_objects", "ObjectType": "PROCEDURE", "ObjectName": "add_employee", - "Reason": "XML functions are not yet supported in YugabyteDB", + "Reason": "XML functions are not yet supported in YugabyteDB.", "SqlStatement": "SELECT e.id, x.employee_xml\n FROM employees e\n JOIN (\n SELECT xmlelement(name \"employee\", xmlattributes(e.id AS \"id\"), e.name) AS employee_xml\n FROM employees e\n ) x ON x.employee_xml IS NOT NULL\n WHERE xmlexists('//employee[name=\"John Doe\"]' PASSING BY REF x.employee_xml);", "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/1043", @@ -1799,7 +1799,7 @@ "IssueType": "unsupported_plpgsql_objects", "ObjectType": "PROCEDURE", "ObjectName": "add_employee", - "Reason": "Advisory locks are not yet implemented in YugabyteDB", + "Reason": "Advisory locks are not yet implemented in YugabyteDB.", "SqlStatement": "SELECT e.id,\n CASE\n WHEN e.salary \u003e 100000 THEN pg_advisory_lock(e.id)\n ELSE pg_advisory_unlock(e.id)\n END AS lock_status\n FROM employees e;", "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/3642", @@ -1810,7 +1810,7 @@ "IssueType": "unsupported_features", "ObjectType": "MVIEW", "ObjectName": "public.sample_data_view", - "Reason": "XML functions are not yet supported in YugabyteDB", + "Reason": "XML functions are not yet supported in YugabyteDB.", "SqlStatement": "CREATE MATERIALIZED VIEW public.sample_data_view AS\n SELECT sample_data.id,\n sample_data.name,\n sample_data.description,\n XMLFOREST(sample_data.name AS name, sample_data.description AS description) AS xml_data,\n pg_try_advisory_lock((sample_data.id)::bigint) AS lock_acquired,\n sample_data.ctid AS row_ctid,\n sample_data.xmin AS xmin_value\n FROM public.sample_data\n WITH NO DATA;", "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/1043", @@ -1821,7 +1821,7 @@ "IssueType": "unsupported_features", "ObjectType": "MVIEW", "ObjectName": "public.sample_data_view", - "Reason": "Advisory locks are not yet implemented in YugabyteDB", + "Reason": "Advisory locks are not yet implemented in YugabyteDB.", "SqlStatement": "CREATE MATERIALIZED VIEW public.sample_data_view AS\n SELECT sample_data.id,\n sample_data.name,\n sample_data.description,\n XMLFOREST(sample_data.name AS name, sample_data.description AS description) AS xml_data,\n pg_try_advisory_lock((sample_data.id)::bigint) AS lock_acquired,\n sample_data.ctid AS row_ctid,\n sample_data.xmin AS xmin_value\n FROM public.sample_data\n WITH NO DATA;", "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/3642", @@ -1832,7 +1832,7 @@ "IssueType": "unsupported_features", "ObjectType": "MVIEW", "ObjectName": "public.sample_data_view", - "Reason": "System columns are not yet supported in YugabyteDB", + "Reason": "System columns are not yet supported in YugabyteDB.", "SqlStatement": "CREATE MATERIALIZED VIEW public.sample_data_view AS\n SELECT sample_data.id,\n sample_data.name,\n sample_data.description,\n XMLFOREST(sample_data.name AS name, sample_data.description AS description) AS xml_data,\n pg_try_advisory_lock((sample_data.id)::bigint) AS lock_acquired,\n sample_data.ctid AS row_ctid,\n sample_data.xmin AS xmin_value\n FROM public.sample_data\n WITH NO DATA;", "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/24843", @@ -1843,7 +1843,7 @@ "IssueType": "unsupported_features", "ObjectType": "VIEW", "ObjectName": "public.orders_view", - "Reason": "XML functions are not yet supported in YugabyteDB", + "Reason": "XML functions are not yet supported in YugabyteDB.", "SqlStatement": "CREATE VIEW public.orders_view AS\n SELECT orders.order_id,\n orders.customer_name,\n orders.product_name,\n orders.quantity,\n orders.price,\n XMLELEMENT(NAME \"OrderDetails\", XMLELEMENT(NAME \"Customer\", orders.customer_name), XMLELEMENT(NAME \"Product\", orders.product_name), XMLELEMENT(NAME \"Quantity\", orders.quantity), XMLELEMENT(NAME \"TotalPrice\", (orders.price * (orders.quantity)::numeric))) AS order_xml,\n XMLCONCAT(XMLELEMENT(NAME \"Customer\", orders.customer_name), XMLELEMENT(NAME \"Product\", orders.product_name)) AS summary_xml,\n pg_try_advisory_lock((hashtext((orders.customer_name || orders.product_name)))::bigint) AS lock_acquired,\n orders.ctid AS row_ctid,\n orders.xmin AS transaction_id\n FROM public.orders;", "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/1043", @@ -1854,7 +1854,7 @@ "IssueType": "unsupported_features", "ObjectType": "VIEW", "ObjectName": "public.orders_view", - "Reason": "Advisory locks are not yet implemented in YugabyteDB", + "Reason": "Advisory locks are not yet implemented in YugabyteDB.", "SqlStatement": "CREATE VIEW public.orders_view AS\n SELECT orders.order_id,\n orders.customer_name,\n orders.product_name,\n orders.quantity,\n orders.price,\n XMLELEMENT(NAME \"OrderDetails\", XMLELEMENT(NAME \"Customer\", orders.customer_name), XMLELEMENT(NAME \"Product\", orders.product_name), XMLELEMENT(NAME \"Quantity\", orders.quantity), XMLELEMENT(NAME \"TotalPrice\", (orders.price * (orders.quantity)::numeric))) AS order_xml,\n XMLCONCAT(XMLELEMENT(NAME \"Customer\", orders.customer_name), XMLELEMENT(NAME \"Product\", orders.product_name)) AS summary_xml,\n pg_try_advisory_lock((hashtext((orders.customer_name || orders.product_name)))::bigint) AS lock_acquired,\n orders.ctid AS row_ctid,\n orders.xmin AS transaction_id\n FROM public.orders;", "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/3642", @@ -1865,7 +1865,7 @@ "IssueType": "unsupported_features", "ObjectType": "VIEW", "ObjectName": "public.orders_view", - "Reason": "System columns are not yet supported in YugabyteDB", + "Reason": "System columns are not yet supported in YugabyteDB.", "SqlStatement": "CREATE VIEW public.orders_view AS\n SELECT orders.order_id,\n orders.customer_name,\n orders.product_name,\n orders.quantity,\n orders.price,\n XMLELEMENT(NAME \"OrderDetails\", XMLELEMENT(NAME \"Customer\", orders.customer_name), XMLELEMENT(NAME \"Product\", orders.product_name), XMLELEMENT(NAME \"Quantity\", orders.quantity), XMLELEMENT(NAME \"TotalPrice\", (orders.price * (orders.quantity)::numeric))) AS order_xml,\n XMLCONCAT(XMLELEMENT(NAME \"Customer\", orders.customer_name), XMLELEMENT(NAME \"Product\", orders.product_name)) AS summary_xml,\n pg_try_advisory_lock((hashtext((orders.customer_name || orders.product_name)))::bigint) AS lock_acquired,\n orders.ctid AS row_ctid,\n orders.xmin AS transaction_id\n FROM public.orders;", "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/24843", @@ -2041,7 +2041,7 @@ "IssueType": "unsupported_features", "ObjectType": "VIEW", "ObjectName": "top_employees_view", - "Reason": "FETCH .. WITH TIES is not yet supported in YugabyteDB", + "Reason": "FETCH .. WITH TIES is not yet supported in YugabyteDB.", "SqlStatement": "CREATE VIEW top_employees_view AS SELECT * FROM (\n\t\t\tSELECT * FROM employees\n\t\t\tORDER BY salary DESC\n\t\t\tFETCH FIRST 2 ROWS WITH TIES\n\t\t) AS top_employees;", "Suggestion": "", "GH": "https://github.com/yugabyte/yugabyte-db/issues/25575", diff --git a/migtests/tests/pg/adventureworks/expected_files/expected_schema_analysis_report.json b/migtests/tests/pg/adventureworks/expected_files/expected_schema_analysis_report.json index c64c3cc5c0..c78e2e97c9 100755 --- a/migtests/tests/pg/adventureworks/expected_files/expected_schema_analysis_report.json +++ b/migtests/tests/pg/adventureworks/expected_files/expected_schema_analysis_report.json @@ -973,7 +973,7 @@ "IssueType": "unsupported_features", "ObjectType": "VIEW", "ObjectName": "humanresources.vjobcandidate", - "Reason": "XML functions are not yet supported in YugabyteDB", + "Reason": "XML functions are not yet supported in YugabyteDB.", "SqlStatement": "CREATE VIEW humanresources.vjobcandidate AS\n SELECT jobcandidateid,\n businessentityid,\n ((xpath('/n:Resume/n:Name/n:Name.Prefix/text()'::text, resume, '{{n,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume}}'::text[]))[1])::character varying(30) AS \"Name.Prefix\",\n ((xpath('/n:Resume/n:Name/n:Name.First/text()'::text, resume, '{{n,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume}}'::text[]))[1])::character varying(30) AS \"Name.First\",\n ((xpath('/n:Resume/n:Name/n:Name.Middle/text()'::text, resume, '{{n,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume}}'::text[]))[1])::character varying(30) AS \"Name.Middle\",\n ((xpath('/n:Resume/n:Name/n:Name.Last/text()'::text, resume, '{{n,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume}}'::text[]))[1])::character varying(30) AS \"Name.Last\",\n ((xpath('/n:Resume/n:Name/n:Name.Suffix/text()'::text, resume, '{{n,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume}}'::text[]))[1])::character varying(30) AS \"Name.Suffix\",\n ((xpath('/n:Resume/n:Skills/text()'::text, resume, '{{n,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume}}'::text[]))[1])::character varying AS \"Skills\",\n ((xpath('n:Address/n:Addr.Type/text()'::text, resume, '{{n,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume}}'::text[]))[1])::character varying(30) AS \"Addr.Type\",\n ((xpath('n:Address/n:Addr.Location/n:Location/n:Loc.CountryRegion/text()'::text, resume, '{{n,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume}}'::text[]))[1])::character varying(100) AS \"Addr.Loc.CountryRegion\",\n ((xpath('n:Address/n:Addr.Location/n:Location/n:Loc.State/text()'::text, resume, '{{n,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume}}'::text[]))[1])::character varying(100) AS \"Addr.Loc.State\",\n ((xpath('n:Address/n:Addr.Location/n:Location/n:Loc.City/text()'::text, resume, '{{n,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume}}'::text[]))[1])::character varying(100) AS \"Addr.Loc.City\",\n ((xpath('n:Address/n:Addr.PostalCode/text()'::text, resume, '{{n,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume}}'::text[]))[1])::character varying(20) AS \"Addr.PostalCode\",\n ((xpath('/n:Resume/n:EMail/text()'::text, resume, '{{n,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume}}'::text[]))[1])::character varying AS \"EMail\",\n ((xpath('/n:Resume/n:WebSite/text()'::text, resume, '{{n,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume}}'::text[]))[1])::character varying AS \"WebSite\",\n modifieddate\n FROM humanresources.jobcandidate;", "FilePath": "/Users/priyanshigupta/Documents/voyager/yb-voyager/migtests/tests/pg/adventureworks/export-dir/schema/views/view.sql", "Suggestion": "", @@ -985,7 +985,7 @@ "IssueType": "unsupported_features", "ObjectType": "VIEW", "ObjectName": "humanresources.vjobcandidateeducation", - "Reason": "XML functions are not yet supported in YugabyteDB", + "Reason": "XML functions are not yet supported in YugabyteDB.", "SqlStatement": "CREATE VIEW humanresources.vjobcandidateeducation AS\n SELECT jobcandidateid,\n ((xpath('/root/ns:Education/ns:Edu.Level/text()'::text, doc, '{{ns,http://adventureworks.com}}'::text[]))[1])::character varying(50) AS \"Edu.Level\",\n (((xpath('/root/ns:Education/ns:Edu.StartDate/text()'::text, doc, '{{ns,http://adventureworks.com}}'::text[]))[1])::character varying(20))::date AS \"Edu.StartDate\",\n (((xpath('/root/ns:Education/ns:Edu.EndDate/text()'::text, doc, '{{ns,http://adventureworks.com}}'::text[]))[1])::character varying(20))::date AS \"Edu.EndDate\",\n ((xpath('/root/ns:Education/ns:Edu.Degree/text()'::text, doc, '{{ns,http://adventureworks.com}}'::text[]))[1])::character varying(50) AS \"Edu.Degree\",\n ((xpath('/root/ns:Education/ns:Edu.Major/text()'::text, doc, '{{ns,http://adventureworks.com}}'::text[]))[1])::character varying(50) AS \"Edu.Major\",\n ((xpath('/root/ns:Education/ns:Edu.Minor/text()'::text, doc, '{{ns,http://adventureworks.com}}'::text[]))[1])::character varying(50) AS \"Edu.Minor\",\n ((xpath('/root/ns:Education/ns:Edu.GPA/text()'::text, doc, '{{ns,http://adventureworks.com}}'::text[]))[1])::character varying(5) AS \"Edu.GPA\",\n ((xpath('/root/ns:Education/ns:Edu.GPAScale/text()'::text, doc, '{{ns,http://adventureworks.com}}'::text[]))[1])::character varying(5) AS \"Edu.GPAScale\",\n ((xpath('/root/ns:Education/ns:Edu.School/text()'::text, doc, '{{ns,http://adventureworks.com}}'::text[]))[1])::character varying(100) AS \"Edu.School\",\n ((xpath('/root/ns:Education/ns:Edu.Location/ns:Location/ns:Loc.CountryRegion/text()'::text, doc, '{{ns,http://adventureworks.com}}'::text[]))[1])::character varying(100) AS \"Edu.Loc.CountryRegion\",\n ((xpath('/root/ns:Education/ns:Edu.Location/ns:Location/ns:Loc.State/text()'::text, doc, '{{ns,http://adventureworks.com}}'::text[]))[1])::character varying(100) AS \"Edu.Loc.State\",\n ((xpath('/root/ns:Education/ns:Edu.Location/ns:Location/ns:Loc.City/text()'::text, doc, '{{ns,http://adventureworks.com}}'::text[]))[1])::character varying(100) AS \"Edu.Loc.City\"\n FROM ( SELECT unnesting.jobcandidateid,\n ((('\u003croot xmlns:ns=\"http://adventureworks.com\"\u003e'::text || ((unnesting.education)::character varying)::text) || '\u003c/root\u003e'::text))::xml AS doc\n FROM ( SELECT jobcandidate.jobcandidateid,\n unnest(xpath('/ns:Resume/ns:Education'::text, jobcandidate.resume, '{{ns,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume}}'::text[])) AS education\n FROM humanresources.jobcandidate) unnesting) jc;", "FilePath": "/Users/priyanshigupta/Documents/voyager/yb-voyager/migtests/tests/pg/adventureworks/export-dir/schema/views/view.sql", "Suggestion": "", @@ -997,7 +997,7 @@ "IssueType": "unsupported_features", "ObjectType": "VIEW", "ObjectName": "humanresources.vjobcandidateemployment", - "Reason": "XML functions are not yet supported in YugabyteDB", + "Reason": "XML functions are not yet supported in YugabyteDB.", "SqlStatement": "CREATE VIEW humanresources.vjobcandidateemployment AS\n SELECT jobcandidateid,\n ((unnest(xpath('/ns:Resume/ns:Employment/ns:Emp.StartDate/text()'::text, resume, '{{ns,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume}}'::text[])))::character varying(20))::date AS \"Emp.StartDate\",\n ((unnest(xpath('/ns:Resume/ns:Employment/ns:Emp.EndDate/text()'::text, resume, '{{ns,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume}}'::text[])))::character varying(20))::date AS \"Emp.EndDate\",\n (unnest(xpath('/ns:Resume/ns:Employment/ns:Emp.OrgName/text()'::text, resume, '{{ns,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume}}'::text[])))::character varying(100) AS \"Emp.OrgName\",\n (unnest(xpath('/ns:Resume/ns:Employment/ns:Emp.JobTitle/text()'::text, resume, '{{ns,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume}}'::text[])))::character varying(100) AS \"Emp.JobTitle\",\n (unnest(xpath('/ns:Resume/ns:Employment/ns:Emp.Responsibility/text()'::text, resume, '{{ns,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume}}'::text[])))::character varying AS \"Emp.Responsibility\",\n (unnest(xpath('/ns:Resume/ns:Employment/ns:Emp.FunctionCategory/text()'::text, resume, '{{ns,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume}}'::text[])))::character varying AS \"Emp.FunctionCategory\",\n (unnest(xpath('/ns:Resume/ns:Employment/ns:Emp.IndustryCategory/text()'::text, resume, '{{ns,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume}}'::text[])))::character varying AS \"Emp.IndustryCategory\",\n (unnest(xpath('/ns:Resume/ns:Employment/ns:Emp.Location/ns:Location/ns:Loc.CountryRegion/text()'::text, resume, '{{ns,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume}}'::text[])))::character varying AS \"Emp.Loc.CountryRegion\",\n (unnest(xpath('/ns:Resume/ns:Employment/ns:Emp.Location/ns:Location/ns:Loc.State/text()'::text, resume, '{{ns,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume}}'::text[])))::character varying AS \"Emp.Loc.State\",\n (unnest(xpath('/ns:Resume/ns:Employment/ns:Emp.Location/ns:Location/ns:Loc.City/text()'::text, resume, '{{ns,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/Resume}}'::text[])))::character varying AS \"Emp.Loc.City\"\n FROM humanresources.jobcandidate;", "FilePath": "/Users/priyanshigupta/Documents/voyager/yb-voyager/migtests/tests/pg/adventureworks/export-dir/schema/views/view.sql", "Suggestion": "", @@ -1009,7 +1009,7 @@ "IssueType": "unsupported_features", "ObjectType": "VIEW", "ObjectName": "person.vadditionalcontactinfo", - "Reason": "XML functions are not yet supported in YugabyteDB", + "Reason": "XML functions are not yet supported in YugabyteDB.", "SqlStatement": "CREATE VIEW person.vadditionalcontactinfo AS\n SELECT p.businessentityid,\n p.firstname,\n p.middlename,\n p.lastname,\n (xpath('(act:telephoneNumber)[1]/act:number/text()'::text, additional.node, '{{act,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes}}'::text[]))[1] AS telephonenumber,\n btrim((((xpath('(act:telephoneNumber)[1]/act:SpecialInstructions/text()'::text, additional.node, '{{act,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes}}'::text[]))[1])::character varying)::text) AS telephonespecialinstructions,\n (xpath('(act:homePostalAddress)[1]/act:Street/text()'::text, additional.node, '{{act,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes}}'::text[]))[1] AS street,\n (xpath('(act:homePostalAddress)[1]/act:City/text()'::text, additional.node, '{{act,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes}}'::text[]))[1] AS city,\n (xpath('(act:homePostalAddress)[1]/act:StateProvince/text()'::text, additional.node, '{{act,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes}}'::text[]))[1] AS stateprovince,\n (xpath('(act:homePostalAddress)[1]/act:PostalCode/text()'::text, additional.node, '{{act,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes}}'::text[]))[1] AS postalcode,\n (xpath('(act:homePostalAddress)[1]/act:CountryRegion/text()'::text, additional.node, '{{act,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes}}'::text[]))[1] AS countryregion,\n (xpath('(act:homePostalAddress)[1]/act:SpecialInstructions/text()'::text, additional.node, '{{act,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes}}'::text[]))[1] AS homeaddressspecialinstructions,\n (xpath('(act:eMail)[1]/act:eMailAddress/text()'::text, additional.node, '{{act,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes}}'::text[]))[1] AS emailaddress,\n btrim((((xpath('(act:eMail)[1]/act:SpecialInstructions/text()'::text, additional.node, '{{act,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes}}'::text[]))[1])::character varying)::text) AS emailspecialinstructions,\n (xpath('((act:eMail)[1]/act:SpecialInstructions/act:telephoneNumber)[1]/act:number/text()'::text, additional.node, '{{act,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactTypes}}'::text[]))[1] AS emailtelephonenumber,\n p.rowguid,\n p.modifieddate\n FROM (person.person p\n LEFT JOIN ( SELECT person.businessentityid,\n unnest(xpath('/ci:AdditionalContactInfo'::text, person.additionalcontactinfo, '{{ci,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ContactInfo}}'::text[])) AS node\n FROM person.person\n WHERE (person.additionalcontactinfo IS NOT NULL)) additional ON ((p.businessentityid = additional.businessentityid)));", "FilePath": "/Users/priyanshigupta/Documents/voyager/yb-voyager/migtests/tests/pg/adventureworks/export-dir/schema/views/view.sql", "Suggestion": "", @@ -1021,7 +1021,7 @@ "IssueType": "unsupported_features", "ObjectType": "VIEW", "ObjectName": "production.vproductmodelcatalogdescription", - "Reason": "XML functions are not yet supported in YugabyteDB", + "Reason": "XML functions are not yet supported in YugabyteDB.", "SqlStatement": "CREATE VIEW production.vproductmodelcatalogdescription AS\n SELECT productmodelid,\n name,\n ((xpath('/p1:ProductDescription/p1:Summary/html:p/text()'::text, catalogdescription, '{{p1,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription},{html,http://www.w3.org/1999/xhtml}}'::text[]))[1])::character varying AS \"Summary\",\n ((xpath('/p1:ProductDescription/p1:Manufacturer/p1:Name/text()'::text, catalogdescription, '{{p1,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription}}'::text[]))[1])::character varying AS manufacturer,\n ((xpath('/p1:ProductDescription/p1:Manufacturer/p1:Copyright/text()'::text, catalogdescription, '{{p1,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription}}'::text[]))[1])::character varying(30) AS copyright,\n ((xpath('/p1:ProductDescription/p1:Manufacturer/p1:ProductURL/text()'::text, catalogdescription, '{{p1,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription}}'::text[]))[1])::character varying(256) AS producturl,\n ((xpath('/p1:ProductDescription/p1:Features/wm:Warranty/wm:WarrantyPeriod/text()'::text, catalogdescription, '{{p1,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription},{wm,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelWarrAndMain}}'::text[]))[1])::character varying(256) AS warrantyperiod,\n ((xpath('/p1:ProductDescription/p1:Features/wm:Warranty/wm:Description/text()'::text, catalogdescription, '{{p1,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription},{wm,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelWarrAndMain}}'::text[]))[1])::character varying(256) AS warrantydescription,\n ((xpath('/p1:ProductDescription/p1:Features/wm:Maintenance/wm:NoOfYears/text()'::text, catalogdescription, '{{p1,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription},{wm,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelWarrAndMain}}'::text[]))[1])::character varying(256) AS noofyears,\n ((xpath('/p1:ProductDescription/p1:Features/wm:Maintenance/wm:Description/text()'::text, catalogdescription, '{{p1,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription},{wm,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelWarrAndMain}}'::text[]))[1])::character varying(256) AS maintenancedescription,\n ((xpath('/p1:ProductDescription/p1:Features/wf:wheel/text()'::text, catalogdescription, '{{p1,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription},{wf,http://www.adventure-works.com/schemas/OtherFeatures}}'::text[]))[1])::character varying(256) AS wheel,\n ((xpath('/p1:ProductDescription/p1:Features/wf:saddle/text()'::text, catalogdescription, '{{p1,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription},{wf,http://www.adventure-works.com/schemas/OtherFeatures}}'::text[]))[1])::character varying(256) AS saddle,\n ((xpath('/p1:ProductDescription/p1:Features/wf:pedal/text()'::text, catalogdescription, '{{p1,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription},{wf,http://www.adventure-works.com/schemas/OtherFeatures}}'::text[]))[1])::character varying(256) AS pedal,\n ((xpath('/p1:ProductDescription/p1:Features/wf:BikeFrame/text()'::text, catalogdescription, '{{p1,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription},{wf,http://www.adventure-works.com/schemas/OtherFeatures}}'::text[]))[1])::character varying AS bikeframe,\n ((xpath('/p1:ProductDescription/p1:Features/wf:crankset/text()'::text, catalogdescription, '{{p1,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription},{wf,http://www.adventure-works.com/schemas/OtherFeatures}}'::text[]))[1])::character varying(256) AS crankset,\n ((xpath('/p1:ProductDescription/p1:Picture/p1:Angle/text()'::text, catalogdescription, '{{p1,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription}}'::text[]))[1])::character varying(256) AS pictureangle,\n ((xpath('/p1:ProductDescription/p1:Picture/p1:Size/text()'::text, catalogdescription, '{{p1,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription}}'::text[]))[1])::character varying(256) AS picturesize,\n ((xpath('/p1:ProductDescription/p1:Picture/p1:ProductPhotoID/text()'::text, catalogdescription, '{{p1,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription}}'::text[]))[1])::character varying(256) AS productphotoid,\n ((xpath('/p1:ProductDescription/p1:Specifications/Material/text()'::text, catalogdescription, '{{p1,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription}}'::text[]))[1])::character varying(256) AS material,\n ((xpath('/p1:ProductDescription/p1:Specifications/Color/text()'::text, catalogdescription, '{{p1,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription}}'::text[]))[1])::character varying(256) AS color,\n ((xpath('/p1:ProductDescription/p1:Specifications/ProductLine/text()'::text, catalogdescription, '{{p1,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription}}'::text[]))[1])::character varying(256) AS productline,\n ((xpath('/p1:ProductDescription/p1:Specifications/Style/text()'::text, catalogdescription, '{{p1,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription}}'::text[]))[1])::character varying(256) AS style,\n ((xpath('/p1:ProductDescription/p1:Specifications/RiderExperience/text()'::text, catalogdescription, '{{p1,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelDescription}}'::text[]))[1])::character varying(1024) AS riderexperience,\n rowguid,\n modifieddate\n FROM production.productmodel\n WHERE (catalogdescription IS NOT NULL);", "FilePath": "/Users/priyanshigupta/Documents/voyager/yb-voyager/migtests/tests/pg/adventureworks/export-dir/schema/views/view.sql", "Suggestion": "", @@ -1033,7 +1033,7 @@ "IssueType": "unsupported_features", "ObjectType": "VIEW", "ObjectName": "production.vproductmodelinstructions", - "Reason": "XML functions are not yet supported in YugabyteDB", + "Reason": "XML functions are not yet supported in YugabyteDB.", "SqlStatement": "CREATE VIEW production.vproductmodelinstructions AS\n SELECT productmodelid,\n name,\n ((xpath('/ns:root/text()'::text, instructions, '{{ns,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelManuInstructions}}'::text[]))[1])::character varying AS instructions,\n (((xpath('@LocationID'::text, mfginstructions))[1])::character varying)::integer AS \"LocationID\",\n (((xpath('@SetupHours'::text, mfginstructions))[1])::character varying)::numeric(9,4) AS \"SetupHours\",\n (((xpath('@MachineHours'::text, mfginstructions))[1])::character varying)::numeric(9,4) AS \"MachineHours\",\n (((xpath('@LaborHours'::text, mfginstructions))[1])::character varying)::numeric(9,4) AS \"LaborHours\",\n (((xpath('@LotSize'::text, mfginstructions))[1])::character varying)::integer AS \"LotSize\",\n ((xpath('/step/text()'::text, step))[1])::character varying(1024) AS \"Step\",\n rowguid,\n modifieddate\n FROM ( SELECT locations.productmodelid,\n locations.name,\n locations.rowguid,\n locations.modifieddate,\n locations.instructions,\n locations.mfginstructions,\n unnest(xpath('step'::text, locations.mfginstructions)) AS step\n FROM ( SELECT productmodel.productmodelid,\n productmodel.name,\n productmodel.rowguid,\n productmodel.modifieddate,\n productmodel.instructions,\n unnest(xpath('/ns:root/ns:Location'::text, productmodel.instructions, '{{ns,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/ProductModelManuInstructions}}'::text[])) AS mfginstructions\n FROM production.productmodel) locations) pm;", "FilePath": "/Users/priyanshigupta/Documents/voyager/yb-voyager/migtests/tests/pg/adventureworks/export-dir/schema/views/view.sql", "Suggestion": "", @@ -1045,7 +1045,7 @@ "IssueType": "unsupported_features", "ObjectType": "VIEW", "ObjectName": "sales.vpersondemographics", - "Reason": "XML functions are not yet supported in YugabyteDB", + "Reason": "XML functions are not yet supported in YugabyteDB.", "SqlStatement": "CREATE VIEW sales.vpersondemographics AS\n SELECT businessentityid,\n (((xpath('n:TotalPurchaseYTD/text()'::text, demographics, '{{n,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey}}'::text[]))[1])::character varying)::money AS totalpurchaseytd,\n (((xpath('n:DateFirstPurchase/text()'::text, demographics, '{{n,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey}}'::text[]))[1])::character varying)::date AS datefirstpurchase,\n (((xpath('n:BirthDate/text()'::text, demographics, '{{n,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey}}'::text[]))[1])::character varying)::date AS birthdate,\n ((xpath('n:MaritalStatus/text()'::text, demographics, '{{n,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey}}'::text[]))[1])::character varying(1) AS maritalstatus,\n ((xpath('n:YearlyIncome/text()'::text, demographics, '{{n,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey}}'::text[]))[1])::character varying(30) AS yearlyincome,\n ((xpath('n:Gender/text()'::text, demographics, '{{n,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey}}'::text[]))[1])::character varying(1) AS gender,\n (((xpath('n:TotalChildren/text()'::text, demographics, '{{n,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey}}'::text[]))[1])::character varying)::integer AS totalchildren,\n (((xpath('n:NumberChildrenAtHome/text()'::text, demographics, '{{n,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey}}'::text[]))[1])::character varying)::integer AS numberchildrenathome,\n ((xpath('n:Education/text()'::text, demographics, '{{n,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey}}'::text[]))[1])::character varying(30) AS education,\n ((xpath('n:Occupation/text()'::text, demographics, '{{n,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey}}'::text[]))[1])::character varying(30) AS occupation,\n (((xpath('n:HomeOwnerFlag/text()'::text, demographics, '{{n,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey}}'::text[]))[1])::character varying)::boolean AS homeownerflag,\n (((xpath('n:NumberCarsOwned/text()'::text, demographics, '{{n,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/IndividualSurvey}}'::text[]))[1])::character varying)::integer AS numbercarsowned\n FROM person.person\n WHERE (demographics IS NOT NULL);", "FilePath": "/Users/priyanshigupta/Documents/voyager/yb-voyager/migtests/tests/pg/adventureworks/export-dir/schema/views/view.sql", "Suggestion": "", @@ -1057,7 +1057,7 @@ "IssueType": "unsupported_features", "ObjectType": "VIEW", "ObjectName": "sales.vstorewithdemographics", - "Reason": "XML functions are not yet supported in YugabyteDB", + "Reason": "XML functions are not yet supported in YugabyteDB.", "SqlStatement": "CREATE VIEW sales.vstorewithdemographics AS\n SELECT businessentityid,\n name,\n ((unnest(xpath('/ns:StoreSurvey/ns:AnnualSales/text()'::text, demographics, '{{ns,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey}}'::text[])))::character varying)::money AS \"AnnualSales\",\n ((unnest(xpath('/ns:StoreSurvey/ns:AnnualRevenue/text()'::text, demographics, '{{ns,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey}}'::text[])))::character varying)::money AS \"AnnualRevenue\",\n (unnest(xpath('/ns:StoreSurvey/ns:BankName/text()'::text, demographics, '{{ns,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey}}'::text[])))::character varying(50) AS \"BankName\",\n (unnest(xpath('/ns:StoreSurvey/ns:BusinessType/text()'::text, demographics, '{{ns,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey}}'::text[])))::character varying(5) AS \"BusinessType\",\n ((unnest(xpath('/ns:StoreSurvey/ns:YearOpened/text()'::text, demographics, '{{ns,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey}}'::text[])))::character varying)::integer AS \"YearOpened\",\n (unnest(xpath('/ns:StoreSurvey/ns:Specialty/text()'::text, demographics, '{{ns,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey}}'::text[])))::character varying(50) AS \"Specialty\",\n ((unnest(xpath('/ns:StoreSurvey/ns:SquareFeet/text()'::text, demographics, '{{ns,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey}}'::text[])))::character varying)::integer AS \"SquareFeet\",\n (unnest(xpath('/ns:StoreSurvey/ns:Brands/text()'::text, demographics, '{{ns,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey}}'::text[])))::character varying(30) AS \"Brands\",\n (unnest(xpath('/ns:StoreSurvey/ns:Internet/text()'::text, demographics, '{{ns,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey}}'::text[])))::character varying(30) AS \"Internet\",\n ((unnest(xpath('/ns:StoreSurvey/ns:NumberEmployees/text()'::text, demographics, '{{ns,http://schemas.microsoft.com/sqlserver/2004/07/adventure-works/StoreSurvey}}'::text[])))::character varying)::integer AS \"NumberEmployees\"\n FROM sales.store;", "FilePath": "/Users/priyanshigupta/Documents/voyager/yb-voyager/migtests/tests/pg/adventureworks/export-dir/schema/views/view.sql", "Suggestion": "", diff --git a/yb-voyager/src/query/queryissue/constants.go b/yb-voyager/src/query/queryissue/constants.go index d9538f1ac7..4685553517 100644 --- a/yb-voyager/src/query/queryissue/constants.go +++ b/yb-voyager/src/query/queryissue/constants.go @@ -112,21 +112,21 @@ const ( // Note: Any issue description added here should be updated in reasonsIncludingSensitiveInformationToCallhome slice in analyzeSchema.go const ( // for DMLs - ADVISORY_LOCKS_ISSUE_DESCRIPTION = "Advisory locks are not yet implemented in YugabyteDB" - SYSTEM_COLUMNS_ISSUE_DESCRIPTION = "System columns are not yet supported in YugabyteDB" - XML_FUNCTIONS_ISSUE_DESCRIPTION = "XML functions are not yet supported in YugabyteDB" - REGEX_FUNCTIONS_ISSUE_DESCRIPTION = "Regex functions are not yet supported in YugabyteDB" - ANY_VALUE_AGGREGATE_FUNCTION_ISSUE_DESCRIPTION = "any_value function are not supported yet in YugabyteDB" - RANGE_AGGREGATE_FUNCTION_ISSUE_DESCRIPTION = "range_agg, range_intersect_agg function are not supported yet in YugabyteDB" - JSON_CONSTRUCTOR_FUNCTION_ISSUE_DESCRIPTION = "JSON constructor functions from PostgreSQL 17 are not yet supported in YugabyteDB" - JSON_QUERY_FUNCTION_ISSUE_DESCRIPTION = "JSON query functions from PostgreSQL 17 are not yet supported in YugabyteDB" - LO_FUNCTIONS_ISSUE_DESCRIPTION = "Large Objects functions are not supported in YugabyteDB" - JSONB_SUBSCRIPTING_ISSUE_DESCRIPTION = "Jsonb subscripting is not yet supported in YugabyteDB" - JSON_PREDICATE_ISSUE_DESCRIPTION = "IS JSON predicate expressions are not yet supported in YugabyteDB" - COPY_FROM_WHERE_ISSUE_DESCRIPTION = "COPY FROM ... WHERE is not yet supported in YugabyteDB" - COPY_ON_ERROR_ISSUE_DESCRIPTION = "COPY ... ON_ERROR is not yet supported in YugabyteDB" - FETCH_WITH_TIES_ISSUE_DESCRIPTION = "FETCH .. WITH TIES is not yet supported in YugabyteDB" - MERGE_STATEMENT_ISSUE_DESCRIPTION = "MERGE statement is not yet supported in YugabyteDB" + ADVISORY_LOCKS_ISSUE_DESCRIPTION = "Advisory locks are not yet implemented in YugabyteDB." + SYSTEM_COLUMNS_ISSUE_DESCRIPTION = "System columns are not yet supported in YugabyteDB." + XML_FUNCTIONS_ISSUE_DESCRIPTION = "XML functions are not yet supported in YugabyteDB." + REGEX_FUNCTIONS_ISSUE_DESCRIPTION = "Regex functions are not yet supported in YugabyteDB." + ANY_VALUE_AGGREGATE_FUNCTION_ISSUE_DESCRIPTION = "any_value function are not supported yet in YugabyteDB." + RANGE_AGGREGATE_FUNCTION_ISSUE_DESCRIPTION = "range_agg, range_intersect_agg function are not supported yet in YugabyteDB." + JSON_CONSTRUCTOR_FUNCTION_ISSUE_DESCRIPTION = "JSON constructor functions from PostgreSQL 17 are not yet supported in YugabyteDB." + JSON_QUERY_FUNCTION_ISSUE_DESCRIPTION = "JSON query functions from PostgreSQL 17 are not yet supported in YugabyteDB." + LO_FUNCTIONS_ISSUE_DESCRIPTION = "Large Objects functions are not supported in YugabyteDB." + JSONB_SUBSCRIPTING_ISSUE_DESCRIPTION = "Jsonb subscripting is not yet supported in YugabyteDB." + JSON_PREDICATE_ISSUE_DESCRIPTION = "IS JSON predicate expressions are not yet supported in YugabyteDB." + COPY_FROM_WHERE_ISSUE_DESCRIPTION = "COPY FROM ... WHERE is not yet supported in YugabyteDB." + COPY_ON_ERROR_ISSUE_DESCRIPTION = "COPY ... ON_ERROR is not yet supported in YugabyteDB." + FETCH_WITH_TIES_ISSUE_DESCRIPTION = "FETCH .. WITH TIES is not yet supported in YugabyteDB." + MERGE_STATEMENT_ISSUE_DESCRIPTION = "MERGE statement is not yet supported in YugabyteDB." // for DDLs // NOTE: In Description string we something can be sensitive information(like object names) which should not be sent to callhome diff --git a/yb-voyager/src/query/queryissue/issues_dml.go b/yb-voyager/src/query/queryissue/issues_dml.go index 02a5472819..d01c36cde2 100644 --- a/yb-voyager/src/query/queryissue/issues_dml.go +++ b/yb-voyager/src/query/queryissue/issues_dml.go @@ -268,7 +268,7 @@ var mergeStatementIssue = issue.Issue{ Name: "Merge Statement", Impact: constants.IMPACT_LEVEL_2, Description: MERGE_STATEMENT_ISSUE_DESCRIPTION, - Suggestion: "Use PL/pgSQL to write the logic to get this functionality", + Suggestion: "Use PL/pgSQL to write the logic to get this functionality.", GH: "https://github.com/yugabyte/yugabyte-db/issues/25574", DocsLink: "https://docs.yugabyte.com/preview/yugabyte-voyager/known-issues/postgresql/#merge-command", }