Skip to content

Commit

Permalink
Merge pull request #3 from factset/upgrade-arrow
Browse files Browse the repository at this point in the history
feat: upgrade to arrow@v7
  • Loading branch information
Matt Topol authored Mar 21, 2022
2 parents 13cc2b6 + 1cc2abb commit eb99719
Show file tree
Hide file tree
Showing 12 changed files with 510 additions and 62 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,22 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.13
go-version: ^1.16
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Get dependencies
run: |
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
run: go mod download

- name: Build
run: go build -v .

- name: Test
run: go run github.com/ory/go-acc -o coverage.out . ./sasl ./driver ./internal/data -- -race -v
run: |
go install github.com/ory/go-acc@latest
go-acc -o coverage.out ./... -- -race -v
- name: Codecov
uses: codecov/[email protected]
Expand Down
19 changes: 9 additions & 10 deletions .github/workflows/smoketest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ jobs:
run: |
sudo chmod +rwx -R /opt
mkdir /opt/drill
sh -c 'wget -O - http://apache.mirrors.hoobly.com/drill/drill-1.17.0/apache-drill-1.17.0.tar.gz | tar -xz'
mv apache-drill-1.17.0/* /opt/drill/
sh -c 'wget -O - http://apache.mirrors.hoobly.com/drill/drill-1.19.0/apache-drill-1.19.0.tar.gz | tar -xz'
mv apache-drill-1.19.0/* /opt/drill/
cp smoketest/storage-plugins-override.conf /opt/drill/conf/
if [ $KERBEROS = "true" ]; then
cp smoketest/drill-override-kerberos.conf /opt/drill/conf/drill-override.conf
Expand All @@ -109,20 +109,19 @@ jobs:
id: go

- name: Get dependencies
run: |
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
run: go mod download all

- name: Run smoke test
if: ${{ !matrix.kerberos }}
run: go run github.com/ory/go-acc -o coverage.out . ./sasl ./internal/data -- -race -v -tags smoke -run ^Example$
run: |
go install github.com/ory/go-acc@latest
go-acc -o coverage.out ./... -- -race -v -tags smoke -run ^Example$
- name: Run Smoke Test Kerberos
if: ${{ matrix.kerberos }}
run: go run github.com/ory/go-acc -o coverage.out . ./sasl ./internal/data -- -race -v -tags smoke,kerberos -run ^Example_kerberos$
run: |
go install github.com/ory/go-acc@latest
go-acc -o coverage.out ./... -- -race -v -tags smoke,kerberos -run ^Example_kerberos$
- name: Codecov
uses: codecov/[email protected]
Expand Down
3 changes: 1 addition & 2 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"database/sql/driver"
"errors"
"io"
"net"
"strings"
"sync"
Expand Down Expand Up @@ -531,7 +530,7 @@ func TestClientReqFailUnmarshal(t *testing.T) {

val, err := tt.call(cl)
assert.Nil(t, val)
assert.Same(t, io.ErrUnexpectedEOF, err)
assert.ErrorIs(t, err, proto.Error)
_, ok := cl.queryMap.Load(0)
assert.False(t, ok)
})
Expand Down
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
module github.com/factset/go-drill

go 1.14
go 1.15

require (
github.com/apache/arrow/go/arrow v0.0.0-20200917173304-4716cd39fc09
github.com/apache/arrow/go/v7 v7.0.0
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815
github.com/go-zookeeper/zk v1.0.2
github.com/golang/protobuf v1.4.2
github.com/golang/protobuf v1.5.2
github.com/google/go-github/v32 v32.1.0
github.com/jcmturner/gofork v1.0.0
github.com/jcmturner/gokrb5/v8 v8.4.1
github.com/rs/zerolog v1.19.0
github.com/stretchr/testify v1.6.1
github.com/rs/zerolog v1.21.0
github.com/stretchr/testify v1.7.0
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a // indirect
google.golang.org/protobuf v1.25.0
google.golang.org/protobuf v1.27.1
)
488 changes: 468 additions & 20 deletions go.sum

Large diffs are not rendered by default.

14 changes: 9 additions & 5 deletions internal/data/arrow.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ package data
import (
"reflect"

"github.com/apache/arrow/go/arrow"
"github.com/apache/arrow/go/arrow/array"
"github.com/apache/arrow/go/arrow/bitutil"
"github.com/apache/arrow/go/arrow/decimal128"
"github.com/apache/arrow/go/arrow/memory"
"github.com/apache/arrow/go/v7/arrow"
"github.com/apache/arrow/go/v7/arrow/array"
"github.com/apache/arrow/go/v7/arrow/bitutil"
"github.com/apache/arrow/go/v7/arrow/decimal128"
"github.com/apache/arrow/go/v7/arrow/memory"
"github.com/factset/go-drill/internal/rpc/proto/common"
"github.com/factset/go-drill/internal/rpc/proto/exec/shared"
)
Expand Down Expand Up @@ -51,6 +51,10 @@ func ArrowTypeToReflect(typ arrow.DataType) reflect.Type {
return reflect.TypeOf(arrow.Date64(0))
case arrow.TIME32:
return reflect.TypeOf(arrow.Time32(0))
case arrow.INTERVAL_MONTHS:
return reflect.TypeOf(arrow.MonthInterval(0))
case arrow.INTERVAL_DAY_TIME:
return reflect.TypeOf(arrow.DayTimeInterval{})
case arrow.INTERVAL:
switch typ.(type) {
case *arrow.DayTimeIntervalType:
Expand Down
4 changes: 2 additions & 2 deletions internal/data/arrow_numeric.gen_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions internal/data/arrow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"testing"
"time"

"github.com/apache/arrow/go/arrow"
"github.com/apache/arrow/go/arrow/array"
"github.com/apache/arrow/go/arrow/bitutil"
"github.com/apache/arrow/go/v7/arrow"
"github.com/apache/arrow/go/v7/arrow/array"
"github.com/apache/arrow/go/v7/arrow/bitutil"
"github.com/factset/go-drill/internal/data"
"github.com/factset/go-drill/internal/rpc/proto/common"
"github.com/factset/go-drill/internal/rpc/proto/exec/shared"
Expand Down
4 changes: 2 additions & 2 deletions result_handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"strconv"
"strings"

"github.com/apache/arrow/go/arrow"
"github.com/apache/arrow/go/arrow/array"
"github.com/apache/arrow/go/v7/arrow"
"github.com/apache/arrow/go/v7/arrow/array"
"github.com/factset/go-drill/internal/data"
"github.com/factset/go-drill/internal/rpc/proto/common"
"github.com/factset/go-drill/internal/rpc/proto/exec/shared"
Expand Down
5 changes: 3 additions & 2 deletions result_handle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"reflect"
"testing"

"github.com/apache/arrow/go/arrow"
"github.com/apache/arrow/go/arrow/array"
"github.com/apache/arrow/go/v7/arrow"
"github.com/apache/arrow/go/v7/arrow/array"
"github.com/factset/go-drill/internal/rpc/proto/common"
"github.com/factset/go-drill/internal/rpc/proto/exec/rpc"
"github.com/factset/go-drill/internal/rpc/proto/exec/shared"
Expand Down Expand Up @@ -430,6 +430,7 @@ func (m *mockRecord) NewSlice(i, j int64) array.Record { return nil }
func (m *mockRecord) Schema() *arrow.Schema {
return m.Called().Get(0).(*arrow.Schema)
}
func (m *mockRecord) MarshalJSON() ([]byte, error) { return nil, nil }

func TestRowBatchPrecision(t *testing.T) {
tests := []struct {
Expand Down
2 changes: 1 addition & 1 deletion utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"io"
"net"

"github.com/apache/arrow/go/arrow"
"github.com/apache/arrow/go/v7/arrow"
"github.com/factset/go-drill/internal/rpc/proto/exec/rpc"
"github.com/factset/go-drill/internal/rpc/proto/exec/user"
"google.golang.org/protobuf/proto"
Expand Down
2 changes: 1 addition & 1 deletion utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"io"
"testing"

"github.com/apache/arrow/go/arrow"
"github.com/apache/arrow/go/v7/arrow"
"github.com/factset/go-drill/internal/rpc/proto/exec/rpc"
"github.com/factset/go-drill/internal/rpc/proto/exec/shared"
"github.com/factset/go-drill/internal/rpc/proto/exec/user"
Expand Down

0 comments on commit eb99719

Please sign in to comment.