Skip to content

Commit 764bcf4

Browse files
authored
*: Upgrade arrow to v18 (#955)
* *: Upgrade arrow to v18 * Upgrade custom go version for DST * .github: Upgrade golangci-lint * Fix linter issues * Use latest golangci-lint
1 parent 07a893f commit 764bcf4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+405
-411
lines changed

.errcheck_excludes.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/dst.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
- name: Set up Go
1616
run: |
17-
curl -L -o go-custom-linux-amd64.tar.gz https://github.com/polarsignals/go/releases/download/v0.0.1/go-custom-linux-amd64.tar.gz
17+
curl -L -o go-custom-linux-amd64.tar.gz https://github.com/polarsignals/go/releases/download/v0.0.2/go-custom-linux-amd64.tar.gz
1818
tar -xzf go-custom-linux-amd64.tar.gz
1919
sudo mv go /usr/local/go
2020
echo "/usr/local/go/bin" >> $GITHUB_PATH

.github/workflows/golangci-lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ jobs:
2323
steps:
2424
- uses: actions/setup-go@v5
2525
with:
26-
go-version: ^1.21
26+
go-version: ^1.24
2727

2828
- uses: actions/checkout@v4
2929

3030
- name: golangci-lint
31-
uses: golangci/golangci-lint-action@v6.1.1
31+
uses: golangci/golangci-lint-action@v7.0.0
3232
with:
3333
args: --timeout=10m
34-
version: v1.62.2
34+
version: v2.0.2

.golangci.yml

Lines changed: 55 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,62 @@
1-
run:
2-
deadline: 5m
3-
skip-files:
4-
# Skip autogenerated files.
5-
- ^.*\.(pb|y)\.go$
6-
7-
output:
8-
sort-results: true
9-
1+
version: "2"
102
linters:
113
enable:
124
- depguard
135
- godot
14-
- gofumpt
15-
- goimports
166
- revive
177
- whitespace
18-
19-
issues:
20-
exclude-rules:
21-
- path: bench_test.go
22-
text: 'is unused'
23-
24-
linters-settings:
25-
depguard:
8+
settings:
9+
depguard:
10+
rules:
11+
main:
12+
deny:
13+
- pkg: go.uber.org/atomic
14+
desc: Use sync/atomic instead of go.uber.org/atomic
15+
- pkg: debug/elg
16+
desc: Use github.com/parca-dev/parca/internal/go/debug/elf instead of debug/elf
17+
- pkg: github.com/stretchr/testify/assert
18+
desc: Use github.com/stretchr/testify/require instead of github.com/stretchr/testify/assert
19+
- pkg: github.com/go-kit/kit/log
20+
desc: Use github.com/go-kit/log instead of github.com/go-kit/kit/log
21+
- pkg: github.com/pkg/errors
22+
desc: Use fmt.Errorf instead
23+
- pkg: github.com/segmentio/parquet-go
24+
desc: Use github.com/parquet-go/parquet-go instead
25+
errcheck:
26+
exclude-functions:
27+
- (github.com/go-kit/log.Logger).Log
28+
misspell:
29+
locale: US
30+
staticcheck:
31+
checks:
32+
- all
33+
exclusions:
34+
generated: lax
35+
presets:
36+
- comments
37+
- common-false-positives
38+
- legacy
39+
- std-error-handling
2640
rules:
27-
main:
28-
deny:
29-
- pkg: go.uber.org/atomic
30-
desc: "Use sync/atomic instead of go.uber.org/atomic"
31-
- pkg: debug/elg
32-
desc: "Use github.com/parca-dev/parca/internal/go/debug/elf instead of debug/elf"
33-
- pkg: github.com/stretchr/testify/assert
34-
desc: "Use github.com/stretchr/testify/require instead of github.com/stretchr/testify/assert"
35-
- pkg: github.com/go-kit/kit/log
36-
desc: "Use github.com/go-kit/log instead of github.com/go-kit/kit/log"
37-
- pkg: github.com/pkg/errors
38-
desc: "Use fmt.Errorf instead"
39-
- pkg: github.com/segmentio/parquet-go
40-
desc: "Use github.com/parquet-go/parquet-go instead"
41-
errcheck:
42-
exclude: ./.errcheck_excludes.txt
43-
goimports:
44-
local-prefixes: github.com/polarsignals/frostdb
45-
gofumpt:
46-
extra-rules: true
47-
misspell:
48-
locale: US
49-
staticcheck:
50-
checks:
51-
- all
41+
- path: bench_test.go
42+
text: is unused
43+
paths:
44+
- third_party$
45+
- builtin$
46+
- examples$
47+
formatters:
48+
enable:
49+
- gofumpt
50+
- goimports
51+
settings:
52+
gofumpt:
53+
extra-rules: true
54+
goimports:
55+
local-prefixes:
56+
- github.com/polarsignals/frostdb
57+
exclusions:
58+
generated: lax
59+
paths:
60+
- third_party$
61+
- builtin$
62+
- examples$

aggregate_test.go

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

11-
"github.com/apache/arrow/go/v17/arrow"
12-
"github.com/apache/arrow/go/v17/arrow/array"
13-
"github.com/apache/arrow/go/v17/arrow/memory"
11+
"github.com/apache/arrow-go/v18/arrow"
12+
"github.com/apache/arrow-go/v18/arrow/array"
13+
"github.com/apache/arrow-go/v18/arrow/memory"
1414
"github.com/google/uuid"
1515
"github.com/stretchr/testify/require"
1616

bench_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import (
1010
"testing"
1111
"time"
1212

13-
"github.com/apache/arrow/go/v17/arrow"
14-
"github.com/apache/arrow/go/v17/arrow/array"
15-
"github.com/apache/arrow/go/v17/arrow/memory"
13+
"github.com/apache/arrow-go/v18/arrow"
14+
"github.com/apache/arrow-go/v18/arrow/array"
15+
"github.com/apache/arrow-go/v18/arrow/memory"
1616
"github.com/google/uuid"
1717
"github.com/stretchr/testify/require"
1818

cmd/parquet-tool/cmd/snapshot.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"os"
1212
"path/filepath"
1313

14-
"github.com/apache/arrow/go/v17/arrow/ipc"
14+
"github.com/apache/arrow-go/v18/arrow/ipc"
1515
"github.com/spf13/cobra"
1616

1717
"github.com/polarsignals/frostdb/dynparquet"

cmd/parquet-tool/cmd/util.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"io"
66
"os"
77

8-
"github.com/apache/arrow/go/v17/arrow"
9-
"github.com/apache/arrow/go/v17/arrow/array"
8+
"github.com/apache/arrow-go/v18/arrow"
9+
"github.com/apache/arrow-go/v18/arrow/array"
1010
"github.com/parquet-go/parquet-go"
1111
)
1212

cmd/parquet-tool/cmd/wal.go

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

6-
"github.com/apache/arrow/go/v17/arrow/ipc"
6+
"github.com/apache/arrow-go/v18/arrow/ipc"
77
"github.com/go-kit/log"
88
"github.com/prometheus/client_golang/prometheus"
99
"github.com/spf13/cobra"

db.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import (
1515
"sync/atomic"
1616
"time"
1717

18-
"github.com/apache/arrow/go/v17/arrow/ipc"
19-
"github.com/apache/arrow/go/v17/arrow/util"
18+
"github.com/apache/arrow-go/v18/arrow/ipc"
19+
"github.com/apache/arrow-go/v18/arrow/util"
2020
"github.com/go-kit/log"
2121
"github.com/go-kit/log/level"
2222
"github.com/oklog/ulid/v2"

db_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import (
1414
"testing"
1515
"time"
1616

17-
"github.com/apache/arrow/go/v17/arrow"
18-
"github.com/apache/arrow/go/v17/arrow/array"
19-
"github.com/apache/arrow/go/v17/arrow/memory"
17+
"github.com/apache/arrow-go/v18/arrow"
18+
"github.com/apache/arrow-go/v18/arrow/array"
19+
"github.com/apache/arrow-go/v18/arrow/memory"
2020
"github.com/go-kit/log/level"
2121
"github.com/google/uuid"
2222
"github.com/polarsignals/iceberg-go"
@@ -382,7 +382,7 @@ func Test_DB_WithStorage(t *testing.T) {
382382

383383
func Test_DB_Filter_Block(t *testing.T) {
384384
sanitize := func(name string) string {
385-
return strings.Replace(name, "/", "-", -1)
385+
return strings.ReplaceAll(name, "/", "-")
386386
}
387387

388388
config := NewTableConfig(
@@ -674,7 +674,7 @@ func Test_DB_OpenError(t *testing.T) {
674674

675675
func Test_DB_Block_Optimization(t *testing.T) {
676676
sanitize := func(name string) string {
677-
return strings.Replace(name, "/", "-", -1)
677+
return strings.ReplaceAll(name, "/", "-")
678678
}
679679

680680
config := NewTableConfig(

dst/dst_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ import (
1616
"testing"
1717
"time"
1818

19-
"github.com/apache/arrow/go/v17/arrow"
20-
"github.com/apache/arrow/go/v17/arrow/array"
21-
"github.com/apache/arrow/go/v17/arrow/ipc"
22-
"github.com/apache/arrow/go/v17/arrow/memory"
19+
"github.com/apache/arrow-go/v18/arrow"
20+
"github.com/apache/arrow-go/v18/arrow/array"
21+
"github.com/apache/arrow-go/v18/arrow/ipc"
22+
"github.com/apache/arrow-go/v18/arrow/memory"
2323
"github.com/go-kit/log"
2424
"github.com/go-kit/log/level"
2525
"github.com/google/uuid"

dynparquet/dynamiccolumns.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,7 @@ func deserializeDynamicColumns(columns string) (map[string][]string, error) {
5858
values := make([]string, 0, strings.Count(labels, ","))
5959

6060
var label string
61-
for {
62-
if labels == "" {
63-
break
64-
}
61+
for labels != "" {
6562
label, labels, _ = strings.Cut(labels, ",")
6663
values = append(values, label)
6764
}

dynparquet/hashed.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import (
66
"math"
77
"strings"
88

9-
"github.com/apache/arrow/go/v17/arrow"
10-
"github.com/apache/arrow/go/v17/arrow/array"
11-
"github.com/apache/arrow/go/v17/arrow/memory"
9+
"github.com/apache/arrow-go/v18/arrow"
10+
"github.com/apache/arrow-go/v18/arrow/array"
11+
"github.com/apache/arrow-go/v18/arrow/memory"
1212
"github.com/cespare/xxhash/v2"
1313
"github.com/dgryski/go-metro"
1414
)

dynparquet/reader.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ func (b *SerializedBuffer) String() string {
7676
numRowGroups := b.NumRowGroups()
7777
numRows := b.NumRows()
7878
w := newPrettyWriter()
79-
_, _ = w.Write([]byte(fmt.Sprintf("row groups: %d\ttotal rows: %d\n", numRowGroups, numRows)))
79+
_, _ = fmt.Fprintf(w, "num row groups: %d\tnum rows: %d\n", numRowGroups, numRows)
8080
for i := 0; i < numRowGroups; i++ {
81-
_, _ = w.Write([]byte("---\n"))
81+
_, _ = fmt.Fprint(w, "---\n")
8282
w.writePrettyRowGroup(b.DynamicRowGroup(i))
8383
}
8484
_ = w.Flush()

dynparquet/schema.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -474,31 +474,31 @@ func (s *v1storageLayoutWrapper) GetRepeated() bool {
474474
}
475475

476476
func (s *v1storageLayoutWrapper) GetTypeInt32() int32 {
477-
return int32(s.StorageLayout.GetType())
477+
return int32(s.GetType())
478478
}
479479

480480
func (s *v1storageLayoutWrapper) GetEncodingInt32() int32 {
481-
return int32(s.StorageLayout.GetEncoding())
481+
return int32(s.GetEncoding())
482482
}
483483

484484
func (s *v1storageLayoutWrapper) GetCompressionInt32() int32 {
485-
return int32(s.StorageLayout.GetCompression())
485+
return int32(s.GetCompression())
486486
}
487487

488488
type v2storageLayoutWrapper struct {
489489
*schemav2pb.StorageLayout
490490
}
491491

492492
func (s *v2storageLayoutWrapper) GetTypeInt32() int32 {
493-
return int32(s.StorageLayout.GetType())
493+
return int32(s.GetType())
494494
}
495495

496496
func (s *v2storageLayoutWrapper) GetEncodingInt32() int32 {
497-
return int32(s.StorageLayout.GetEncoding())
497+
return int32(s.GetEncoding())
498498
}
499499

500500
func (s *v2storageLayoutWrapper) GetCompressionInt32() int32 {
501-
return int32(s.StorageLayout.GetCompression())
501+
return int32(s.GetCompression())
502502
}
503503

504504
func StorageLayoutWrapper(_ *schemav2pb.StorageLayout) StorageLayout {
@@ -1184,7 +1184,7 @@ func (s *Schema) GetWriter(w io.Writer, dynamicColumns map[string][]string, sort
11841184
ParquetWriter: pw,
11851185
}, nil
11861186
}
1187-
pooled.(*PooledWriter).ParquetWriter.Reset(w)
1187+
pooled.(*PooledWriter).Reset(w)
11881188
return pooled.(*PooledWriter), nil
11891189
}
11901190

@@ -1239,7 +1239,7 @@ func (s *Schema) PutPooledParquetSchema(ps *PooledParquetSchema) {
12391239
}
12401240

12411241
func (s *Schema) PutWriter(w *PooledWriter) {
1242-
w.ParquetWriter.Reset(bytes.NewBuffer(nil))
1242+
w.Reset(bytes.NewBuffer(nil))
12431243
w.pool.Put(w)
12441244
}
12451245

@@ -1270,7 +1270,7 @@ func (s *Schema) GetBuffer(dynamicColumns map[string][]string) (*PooledBuffer, e
12701270
}
12711271

12721272
func (s *Schema) PutBuffer(b *PooledBuffer) {
1273-
b.Buffer.Reset()
1273+
b.Reset()
12741274
b.pool.Put(b)
12751275
}
12761276

examples/aggregations/aggregations.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ import (
55
"fmt"
66
"log"
77

8-
"github.com/apache/arrow/go/v17/arrow"
9-
"github.com/apache/arrow/go/v17/arrow/memory"
8+
"github.com/apache/arrow-go/v18/arrow"
9+
"github.com/apache/arrow-go/v18/arrow/memory"
1010

1111
"github.com/polarsignals/frostdb"
1212
"github.com/polarsignals/frostdb/query"
1313
"github.com/polarsignals/frostdb/query/logicalplan"
1414
)
1515

16-
// This example demonstrates how to use FrostDB's to aggregate data
16+
// This example demonstrates how to use FrostDB's to aggregate data.
1717
func main() {
1818
// Create a new column store
1919
columnstore, _ := frostdb.New()
@@ -80,7 +80,7 @@ func main() {
8080
},
8181
[]logicalplan.Expr{logicalplan.Col("city.name")},
8282
).
83-
Execute(context.Background(), func(ctx context.Context, r arrow.Record) error {
83+
Execute(context.Background(), func(_ context.Context, r arrow.Record) error {
8484
// print the results
8585
fmt.Println(r)
8686
return nil
@@ -97,7 +97,7 @@ func main() {
9797
},
9898
[]logicalplan.Expr{logicalplan.Col("day")},
9999
).
100-
Execute(context.Background(), func(ctx context.Context, r arrow.Record) error {
100+
Execute(context.Background(), func(_ context.Context, r arrow.Record) error {
101101
// print the results
102102
fmt.Println(r)
103103
return nil

0 commit comments

Comments
 (0)