Skip to content

Commit 4bf80c6

Browse files
authored
feat(salesforce)!: Migrate to Arrow native SDK (#11001)
Closes #10764 BEGIN_COMMIT_OVERRIDE feat: Update to use [Apache Arrow](https://arrow.apache.org/) type system (#11001) BREAKING-CHANGE: This release introduces an internal change to our type system to use [Apache Arrow](https://arrow.apache.org/). This should not have any visible breaking changes, however due to the size of the change we are introducing it under a major version bump to communicate that it might have some bugs that we weren't able to catch during our internal tests. If you encounter an issue during the upgrade, please submit a [bug report](https://github.com/cloudquery/cloudquery/issues/new/choose). You will also need to update destinations depending on which one you use: - Azure Blob Storage >= v3.2.0 - BigQuery >= v3.0.0 - ClickHouse >= v3.1.1 - DuckDB >= v1.1.6 - Elasticsearch >= v2.0.0 - File >= v3.2.0 - Firehose >= v2.0.2 - GCS >= v3.2.0 - Gremlin >= v2.1.10 - Kafka >= v3.0.1 - Meilisearch >= v2.0.1 - Microsoft SQL Server >= v4.2.0 - MongoDB >= v2.0.1 - MySQL >= v2.0.2 - Neo4j >= v3.0.0 - PostgreSQL >= v4.2.0 - S3 >= v4.4.0 - Snowflake >= v2.1.1 - SQLite >= v2.2.0 END_COMMIT_OVERRIDE
1 parent b4f377c commit 4bf80c6

File tree

10 files changed

+34
-32
lines changed

10 files changed

+34
-32
lines changed

plugins/source/salesforce/client/client.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import (
1111
"time"
1212

1313
"github.com/cloudquery/plugin-pb-go/specs"
14-
"github.com/cloudquery/plugin-sdk/v2/plugins/source"
15-
"github.com/cloudquery/plugin-sdk/v2/schema"
14+
"github.com/cloudquery/plugin-sdk/v3/plugins/source"
15+
"github.com/cloudquery/plugin-sdk/v3/schema"
1616
"github.com/rs/zerolog"
1717
)
1818

plugins/source/salesforce/client/multiplexers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package client
33
import (
44
"strings"
55

6-
"github.com/cloudquery/plugin-sdk/v2/schema"
6+
"github.com/cloudquery/plugin-sdk/v3/schema"
77
)
88

99
var unsupportedObjects = map[string]bool{

plugins/source/salesforce/client/testing.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"time"
99

1010
"github.com/cloudquery/plugin-pb-go/specs"
11-
"github.com/cloudquery/plugin-sdk/v2/plugins/source"
12-
"github.com/cloudquery/plugin-sdk/v2/schema"
11+
"github.com/cloudquery/plugin-sdk/v3/plugins/source"
12+
"github.com/cloudquery/plugin-sdk/v3/schema"
1313
"github.com/gorilla/mux"
1414
"github.com/rs/zerolog"
1515
)

plugins/source/salesforce/go.mod

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ module github.com/cloudquery/cloudquery/plugins/source/salesforce
33
go 1.19
44

55
require (
6+
github.com/apache/arrow/go/v13 v13.0.0-20230509040948-de6c3cd2b604
67
github.com/cloudquery/plugin-pb-go v1.0.8
7-
github.com/cloudquery/plugin-sdk/v2 v2.7.0
8+
github.com/cloudquery/plugin-sdk/v3 v3.6.4
89
github.com/gorilla/mux v1.8.0
910
github.com/rs/zerolog v1.29.0
1011
)
1112

12-
// TODO: remove once all updates are merged
13-
replace github.com/apache/arrow/go/v13 => github.com/cloudquery/arrow/go/v13 v13.0.0-20230509053643-898a79b1d3c8
13+
replace github.com/apache/arrow/go/v13 => github.com/cloudquery/arrow/go/v13 v13.0.0-20230525142029-2d32efeedad8
1414

1515
require (
1616
github.com/andybalholm/brotli v1.0.5 // indirect
17-
github.com/apache/arrow/go/v13 v13.0.0-20230509040948-de6c3cd2b604 // indirect
1817
github.com/apache/thrift v0.16.0 // indirect
18+
github.com/cloudquery/plugin-sdk/v2 v2.7.0 // indirect
1919
github.com/davecgh/go-spew v1.1.1 // indirect
2020
github.com/getsentry/sentry-go v0.20.0 // indirect
2121
github.com/ghodss/yaml v1.0.0 // indirect
@@ -34,6 +34,7 @@ require (
3434
github.com/mattn/go-isatty v0.0.18 // indirect
3535
github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8 // indirect
3636
github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3 // indirect
37+
github.com/pierrec/lz4/v4 v4.1.15 // indirect
3738
github.com/pmezard/go-difflib v1.0.0 // indirect
3839
github.com/spf13/cast v1.5.0 // indirect
3940
github.com/spf13/cobra v1.6.1 // indirect

plugins/source/salesforce/go.sum

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,14 @@ github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWR
4444
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
4545
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
4646
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
47-
github.com/cloudquery/arrow/go/v13 v13.0.0-20230509053643-898a79b1d3c8 h1:CmgLSEGQNLHpUQ5cU4L4aF7cuJZRnc1toIIWqC1gmPg=
48-
github.com/cloudquery/arrow/go/v13 v13.0.0-20230509053643-898a79b1d3c8/go.mod h1:/XatdE3kDIBqZKhZ7OBUHwP2jaASDFZHqF4puOWM8po=
47+
github.com/cloudquery/arrow/go/v13 v13.0.0-20230525142029-2d32efeedad8 h1:/mgK+To5HNUzuZDWdVygbfn8oaPG5c7I/8qCxwwpWO8=
48+
github.com/cloudquery/arrow/go/v13 v13.0.0-20230525142029-2d32efeedad8/go.mod h1:/XatdE3kDIBqZKhZ7OBUHwP2jaASDFZHqF4puOWM8po=
4949
github.com/cloudquery/plugin-pb-go v1.0.8 h1:wn3GXhcNItcP+6wUUZuzUFbvdL59liKBO37/izMi+FQ=
5050
github.com/cloudquery/plugin-pb-go v1.0.8/go.mod h1:vAGA27psem7ZZNAY4a3S9TKuA/JDQWstjKcHPJX91Mc=
5151
github.com/cloudquery/plugin-sdk/v2 v2.7.0 h1:hRXsdEiaOxJtsn/wZMFQC9/jPfU1MeMK3KF+gPGqm7U=
5252
github.com/cloudquery/plugin-sdk/v2 v2.7.0/go.mod h1:pAX6ojIW99b/Vg4CkhnsGkRIzNaVEceYMR+Bdit73ug=
53+
github.com/cloudquery/plugin-sdk/v3 v3.6.4 h1:P4OkS5tJYkv3OqeL60DAVqXXbFQUyPKJ5YDtAgjl9b4=
54+
github.com/cloudquery/plugin-sdk/v3 v3.6.4/go.mod h1:3JrZXEULmGXpkOukVaRIzaA63d7TJr9Ukp6hemTjbtc=
5355
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
5456
github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
5557
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
@@ -176,6 +178,7 @@ github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3 h1:+n/aFZefKZp7spd8D
176178
github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE=
177179
github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
178180
github.com/pierrec/lz4/v4 v4.1.15 h1:MO0/ucJhngq7299dKLwIMtgTfbkoSPF6AoMYDd8Q4q0=
181+
github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
179182
github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=
180183
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
181184
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=

plugins/source/salesforce/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"github.com/cloudquery/cloudquery/plugins/source/salesforce/resources/plugin"
55

6-
"github.com/cloudquery/plugin-sdk/v2/serve"
6+
"github.com/cloudquery/plugin-sdk/v3/serve"
77
)
88

99
const sentryDsn = "https://[email protected]/4504390800310272"

plugins/source/salesforce/resources/plugin/plugin.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package plugin
33
import (
44
"github.com/cloudquery/cloudquery/plugins/source/salesforce/client"
55
"github.com/cloudquery/cloudquery/plugins/source/salesforce/resources/services"
6-
"github.com/cloudquery/plugin-sdk/v2/plugins/source"
7-
"github.com/cloudquery/plugin-sdk/v2/schema"
6+
"github.com/cloudquery/plugin-sdk/v3/plugins/source"
7+
"github.com/cloudquery/plugin-sdk/v3/schema"
88
)
99

1010
var (

plugins/source/salesforce/resources/services/objects.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ package services
33
import (
44
"context"
55

6+
"github.com/apache/arrow/go/v13/arrow"
67
"github.com/cloudquery/cloudquery/plugins/source/salesforce/client"
7-
"github.com/cloudquery/plugin-sdk/v2/schema"
8+
"github.com/cloudquery/plugin-sdk/v3/schema"
9+
"github.com/cloudquery/plugin-sdk/v3/types"
810
)
911

1012
func rawResolver(_ context.Context, meta schema.ClientMeta, r *schema.Resource, c schema.Column) error {
@@ -26,26 +28,22 @@ func Objects() *schema.Table {
2628
{
2729
Name: "_cq_raw",
2830
Description: "Raw JSON response",
29-
Type: schema.TypeJSON,
31+
Type: types.ExtensionTypes.JSON,
3032
Resolver: rawResolver,
3133
},
3234
{
3335
Name: "object_type",
3436
Description: "Name of the object.",
35-
Type: schema.TypeString,
37+
Type: arrow.BinaryTypes.String,
3638
Resolver: objectResolver,
37-
CreationOptions: schema.ColumnCreationOptions{
38-
PrimaryKey: true,
39-
},
39+
PrimaryKey: true,
4040
},
4141
{
4242
Name: "id",
4343
Description: "Unique identifier for the object.",
44-
Type: schema.TypeString,
44+
Type: arrow.BinaryTypes.String,
4545
Resolver: schema.PathResolver("Id"),
46-
CreationOptions: schema.ColumnCreationOptions{
47-
PrimaryKey: true,
48-
},
46+
PrimaryKey: true,
4947
},
5048
},
5149
}

plugins/source/salesforce/resources/services/objects_fetch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55

66
"github.com/cloudquery/cloudquery/plugins/source/salesforce/client"
7-
"github.com/cloudquery/plugin-sdk/v2/schema"
7+
"github.com/cloudquery/plugin-sdk/v3/schema"
88
)
99

1010
var notSupportedBulkObjects = map[string]bool{

website/tables/salesforce/salesforce_objects.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ The composite primary key for this table is (**object_type**, **id**).
1010

1111
| Name | Type |
1212
| ------------- | ------------- |
13-
|_cq_source_name|String|
14-
|_cq_sync_time|Timestamp|
15-
|_cq_id|UUID|
16-
|_cq_parent_id|UUID|
17-
|_cq_raw|JSON|
18-
|object_type (PK)|String|
19-
|id (PK)|String|
13+
|_cq_source_name|utf8|
14+
|_cq_sync_time|timestamp[us, tz=UTC]|
15+
|_cq_id|uuid|
16+
|_cq_parent_id|uuid|
17+
|_cq_raw|json|
18+
|object_type (PK)|utf8|
19+
|id (PK)|utf8|

0 commit comments

Comments
 (0)