From cec76cc13b7e97b6fc718457497cb3ca0cfac70b Mon Sep 17 00:00:00 2001 From: Amogh-Bharadwaj Date: Wed, 3 Jan 2024 23:10:42 +0530 Subject: [PATCH 1/3] fix qrep geo test --- flow/e2e/test_utils.go | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/flow/e2e/test_utils.go b/flow/e2e/test_utils.go index 1ed60196eb..f1e584abf8 100644 --- a/flow/e2e/test_utils.go +++ b/flow/e2e/test_utils.go @@ -367,6 +367,12 @@ func GetOwnersSchema() *model.QRecordSchema { {Name: "f6", Type: qvalue.QValueKindJSON, Nullable: true}, {Name: "f7", Type: qvalue.QValueKindJSON, Nullable: true}, {Name: "f8", Type: qvalue.QValueKindInt16, Nullable: true}, + {Name: "geometryPoint", Type: qvalue.QValueKindGeometry, Nullable: true}, + {Name: "geometry_linestring", Type: qvalue.QValueKindGeometry, Nullable: true}, + {Name: "geometry_polygon", Type: qvalue.QValueKindGeometry, Nullable: true}, + {Name: "geography_point", Type: qvalue.QValueKindGeography, Nullable: true}, + {Name: "geography_linestring", Type: qvalue.QValueKindGeography, Nullable: true}, + {Name: "geography_polygon", Type: qvalue.QValueKindGeography, Nullable: true}, }, } } @@ -377,7 +383,16 @@ func GetOwnersSelectorStringsSF() [2]string { sfFields := make([]string, 0, len(schema.Fields)) for _, field := range schema.Fields { pgFields = append(pgFields, fmt.Sprintf(`"%s"`, field.Name)) - sfFields = append(sfFields, connsnowflake.SnowflakeIdentifierNormalize(field.Name)) + if strings.Contains(field.Name, "geo") { + colName := connsnowflake.SnowflakeIdentifierNormalize(field.Name) + + // Have to apply a WKT transformation here, + // else the sql driver we use receives the values as snowflake's OBJECT + // which is troublesome to deal with. Now it receives it as string. + sfFields = append(sfFields, fmt.Sprintf(`ST_ASWKT(%s) as %s`, colName, colName)) + } else { + sfFields = append(sfFields, connsnowflake.SnowflakeIdentifierNormalize(field.Name)) + } } return [2]string{strings.Join(pgFields, ","), strings.Join(sfFields, ",")} } From 310ca7b468982a499a4d3e2a8cbc9a49064d920c Mon Sep 17 00:00:00 2001 From: Amogh-Bharadwaj Date: Wed, 3 Jan 2024 23:23:47 +0530 Subject: [PATCH 2/3] experiment: try cache off --- .github/workflows/golang-lint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/golang-lint.yml b/.github/workflows/golang-lint.yml index 1216a69c3b..ed9dcfac99 100644 --- a/.github/workflows/golang-lint.yml +++ b/.github/workflows/golang-lint.yml @@ -35,5 +35,6 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} golangci_lint_flags: "--timeout 10m" fail_on_error: true + cache: false env: REVIEWDOG_TOKEN: ${{ secrets.REVIEWDOG_TOKEN }} From 3586e1acf535ae75e247645a680aaddf238a8aeb Mon Sep 17 00:00:00 2001 From: Amogh-Bharadwaj Date: Wed, 3 Jan 2024 23:44:50 +0530 Subject: [PATCH 3/3] lint fix attempt 2 --- .github/workflows/golang-lint.yml | 1 - flow/geo/geo.go | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/golang-lint.yml b/.github/workflows/golang-lint.yml index ed9dcfac99..1216a69c3b 100644 --- a/.github/workflows/golang-lint.yml +++ b/.github/workflows/golang-lint.yml @@ -35,6 +35,5 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} golangci_lint_flags: "--timeout 10m" fail_on_error: true - cache: false env: REVIEWDOG_TOKEN: ${{ secrets.REVIEWDOG_TOKEN }} diff --git a/flow/geo/geo.go b/flow/geo/geo.go index 12f5a3107d..74a7daf1a4 100644 --- a/flow/geo/geo.go +++ b/flow/geo/geo.go @@ -1,3 +1,4 @@ +//nolint:all package geo import (