Skip to content

Commit d32a78c

Browse files
authored
test(go): test storage write API in bulk ingest (#111)
1 parent da21d47 commit d32a78c

26 files changed

+1066
-254
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
repos:
1616
- repo: https://github.com/astral-sh/ruff-pre-commit
17-
rev: 36243b70e5ce219623c3503f5afba0f8c96fda55 # frozen: v0.14.7
17+
rev: 0470f7c8a653e950f7cc5a653204ceb3fde4c02a # frozen: v0.15.0
1818
hooks:
1919
- id: ruff-check
2020
name: "ruff check (isort)"
@@ -33,7 +33,7 @@ repos:
3333
)$
3434
3535
- repo: https://github.com/golangci/golangci-lint
36-
rev: e6ebea0145f385056bce15041d3244c0e5e15848 # frozen: v2.7.0
36+
rev: e2e40021c9007020676c93680a36e3ab06c6cd33 # frozen: v2.8.0
3737
hooks:
3838
- id: golangci-lint
3939
entry: bash -c 'cd go && golangci-lint run --fix --timeout 5m'
@@ -56,6 +56,6 @@ repos:
5656
- id: trailing-whitespace
5757

5858
- repo: https://github.com/adbc-drivers/dev
59-
rev: 8ba235d79417939cf59e94ab85204731f7cbb9ba
59+
rev: 30cd0fdecc0d03de3ca2a65acb4595505d3754ca
6060
hooks:
6161
- id: rat

.rat-apache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ go/bigquery_database.go
4747
go/connection.go
4848
go/driver.go
4949
go/driver_test.go
50+
go/pkg/adbc.h
5051
go/pkg/driver.go
5152
go/pkg/utils.c
5253
go/pkg/utils.h

go/bulk_ingest.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,9 @@ func writeFields(b *strings.Builder, fields []arrow.Field, skipName bool) error
263263
}
264264

265265
func createTableStatement(options *driverbase.BulkIngestOptions, schema *arrow.Schema, ifTableExists driverbase.BulkIngestTableExistsBehavior, ifTableMissing driverbase.BulkIngestTableMissingBehavior) (string, error) {
266+
// TODO: refactor this to take in a bigquery Client, and create the
267+
// table by using DatasetInProject.Table.Create, passing in a
268+
// bigquery.TableMetadata, instead of generating SQL
266269
var b strings.Builder
267270

268271
switch ifTableExists {
@@ -271,6 +274,7 @@ func createTableStatement(options *driverbase.BulkIngestOptions, schema *arrow.S
271274
case driverbase.BulkIngestTableExistsIgnore:
272275
// Do nothing
273276
case driverbase.BulkIngestTableExistsDrop:
277+
// TODO: add CatalogName/SchemaName here
274278
b.WriteString("DROP TABLE IF EXISTS ")
275279
b.WriteString(quoteIdentifier(options.TableName))
276280
b.WriteString("; ")

0 commit comments

Comments
 (0)