Skip to content

Commit c72f70c

Browse files
committed
Update dependencies and remove old code
1 parent 0309d68 commit c72f70c

File tree

13 files changed

+263
-979
lines changed

13 files changed

+263
-979
lines changed

datasource/context_wrapper.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ type state struct {
6868
}
6969

7070
// our stack vars that have come from strings in vm eval engine
71-
// such as "user.Name" will try to find struct value with .Name
71+
//
72+
// such as "user.Name" will try to find struct value with .Name
7273
type namedvar struct {
7374
name string
7475
value reflect.Value
@@ -205,7 +206,8 @@ func (s *state) evalField(dot reflect.Value, fieldName string, node expr.Node, a
205206
panic("not reached")
206207
}
207208

208-
func (s *state) evalCall(dot, fun reflect.Value, node expr.Node, name string, args []expr.Node, final reflect.Value) reflect.Value {
209+
// func (s *state) evalCall(dot, fun reflect.Value, node expr.Node, name string, args []expr.Node, final reflect.Value) reflect.Value {
210+
func (s *state) evalCall(_, fun reflect.Value, _ expr.Node, name string, _ []expr.Node, _ reflect.Value) reflect.Value {
209211
typ := fun.Type()
210212
if !goodFunc(typ) {
211213
// TODO: This could still be a confusing error; maybe goodFunc should provide info.

datasource/csv.go

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"compress/gzip"
77
"database/sql/driver"
88
"encoding/csv"
9+
"fmt"
910
"io"
1011
"os"
1112
"strings"
@@ -23,12 +24,13 @@ var (
2324
)
2425

2526
// Csv DataSource, implements qlbridge schema DataSource, SourceConn, Scanner
26-
// to allow csv files to be full featured databases.
27-
// - very, very naive scanner, forward only single pass
28-
// - can open a file with .Open()
29-
// - assumes comma delimited
30-
// - not thread-safe
31-
// - does not implement write operations
27+
//
28+
// to allow csv files to be full featured databases.
29+
// - very, very naive scanner, forward only single pass
30+
// - can open a file with .Open()
31+
// - assumes comma delimited
32+
// - not thread-safe
33+
// - does not implement write operations
3234
type CsvDataSource struct {
3335
table string
3436
tbl *schema.Table
@@ -56,35 +58,30 @@ func NewCsvSource(table string, indexCol int, ior io.Reader, exit <-chan bool) (
5658

5759
first2, err := buf.Peek(2)
5860
if err != nil {
59-
u.Errorf("Error opening bufio.peek for csv reader %v", err)
60-
return nil, err
61+
return nil, fmt.Errorf("opening bufio.peek for csv reader: %w", err)
6162
}
6263

6364
// TODO: move this compression to the file-reader not here
64-
if err == nil && len(first2) == 2 && bytes.Equal(first2, []byte{'\x1F', '\x8B'}) {
65+
if len(first2) == 2 && bytes.Equal(first2, []byte{'\x1F', '\x8B'}) {
6566
gr, err := gzip.NewReader(buf)
6667
if err != nil {
67-
u.Errorf("Could not open reader? %v", err)
68-
return nil, err
68+
return nil, fmt.Errorf("opening reader: %w", err)
6969
}
7070
m.gz = gr
7171
m.csvr = csv.NewReader(gr)
7272
} else {
7373
m.csvr = csv.NewReader(buf)
7474
}
7575

76-
m.csvr.TrailingComma = true // allow empty fields
7776
// if flagCsvDelimiter == "|" {
7877
// m.csvr.Comma = '|'
7978
// } else if flagCsvDelimiter == "\t" || flagCsvDelimiter == "t" {
8079
// m.csvr.Comma = '\t'
8180
// }
8281
headers, err := m.csvr.Read()
8382
if err != nil {
84-
u.Warnf("err csv %v", err)
8583
return nil, err
8684
}
87-
//u.Debugf("headers: %v", headers)
8885
m.headers = headers
8986
m.colindex = make(map[string]int, len(headers))
9087
for i, key := range headers {
@@ -93,7 +90,6 @@ func NewCsvSource(table string, indexCol int, ior io.Reader, exit <-chan bool) (
9390
m.headers[i] = key
9491
}
9592
m.loadTable()
96-
//u.Infof("csv headers: %v colIndex: %v", headers, m.colindex)
9793
return &m, nil
9894
}
9995

@@ -169,7 +165,6 @@ func (m *CsvDataSource) Next() schema.Message {
169165
for i, val := range row {
170166
vals[i] = val
171167
}
172-
//u.Debugf("headers: %#v \n\trows: %#v", m.headers, row)
173168
return NewSqlDriverMessageMap(m.rowct, vals, m.colindex)
174169
}
175170
}

datasource/json.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"compress/gzip"
77
"database/sql/driver"
88
"encoding/json"
9+
"fmt"
910
"io"
1011
"os"
1112
"strings"
@@ -64,12 +65,11 @@ func NewJsonSource(table string, rc io.ReadCloser, exit <-chan bool, lh FileLine
6465
buf := bufio.NewReader(rc)
6566
first2, err := buf.Peek(2)
6667
if err != nil {
67-
u.Warnf("error opening bufio.peek for json reader: %v", err)
68-
return nil, err
68+
return nil, fmt.Errorf("opening bufio.peek for json reader: %w", err)
6969
}
7070

7171
// Gzip Files have these 2 byte prefix
72-
if err == nil && len(first2) == 2 && bytes.Equal(first2, []byte{'\x1F', '\x8B'}) {
72+
if len(first2) == 2 && bytes.Equal(first2, []byte{'\x1F', '\x8B'}) {
7373
gr, err := gzip.NewReader(buf)
7474
if err != nil {
7575
u.Warnf("could not open gzip reader: %v", err)
@@ -173,8 +173,7 @@ func (m *JsonSource) jsonDefaultLine(line []byte) (schema.Message, error) {
173173
jm := make(map[string]interface{})
174174
err := json.Unmarshal(line, &jm)
175175
if err != nil {
176-
u.Warnf("could not read json line: %v %s", err, string(line))
177-
return nil, err
176+
return nil, fmt.Errorf("could not read json line: %w %s", err, string(line))
178177
}
179178
vals := make([]driver.Value, len(jm))
180179
keys := make(map[string]int, len(jm))
@@ -184,6 +183,5 @@ func (m *JsonSource) jsonDefaultLine(line []byte) (schema.Message, error) {
184183
keys[k] = i
185184
i++
186185
}
187-
u.Debugf("json data: %#v \n%#v", keys, vals)
188186
return NewSqlDriverMessageMap(m.rowct, vals, keys), nil
189187
}

expr/builtins/builtins.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,11 @@ import (
66
"fmt"
77
"sync"
88

9-
u "github.com/araddon/gou"
10-
"github.com/pborman/uuid"
11-
129
"github.com/lytics/qlbridge/expr"
1310
"github.com/lytics/qlbridge/value"
11+
"github.com/pborman/uuid"
1412
)
1513

16-
var _ = u.EMPTY
1714
var loadOnce sync.Once
1815

1916
const yymmTimeLayout = "0601"

go.mod

Lines changed: 43 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,39 @@
11
module github.com/lytics/qlbridge
22

3-
go 1.21
3+
go 1.23.0
44

5-
toolchain go1.22.5
5+
toolchain go1.24.1
66

77
require (
88
github.com/araddon/dateparse v0.0.0-20190622164848-0fb0a474d195
9-
github.com/araddon/gou v0.0.0-20190110011759-c797efecbb61
9+
github.com/araddon/gou v0.0.0-20211019181548-e7d08105776c
1010
github.com/blevesearch/bleve/v2 v2.4.4
1111
github.com/dchest/siphash v1.2.1
1212
github.com/go-sql-driver/mysql v1.4.1
1313
github.com/google/btree v1.0.0
1414
github.com/hashicorp/go-memdb v1.0.4
15-
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af
15+
github.com/jmespath/go-jmespath v0.4.0
1616
github.com/jmoiron/sqlx v1.2.0
1717
github.com/leekchan/timeutil v0.0.0-20150802142658-28917288c48d
18-
github.com/lytics/cloudstorage v0.2.1
18+
github.com/lytics/cloudstorage v0.2.16
1919
github.com/lytics/datemath v0.0.0-20180727225141-3ada1c10b5de
2020
github.com/mattn/go-sqlite3 v1.9.0
2121
github.com/mb0/glob v0.0.0-20160210091149-1eb79d2de6c4
2222
github.com/mssola/user_agent v0.5.0
23-
github.com/pborman/uuid v1.2.0
24-
github.com/stretchr/testify v1.8.1
25-
golang.org/x/net v0.0.0-20191021144547-ec77196f6094
26-
google.golang.org/api v0.11.0
27-
google.golang.org/protobuf v1.35.1
23+
github.com/pborman/uuid v1.2.1
24+
github.com/stretchr/testify v1.10.0
25+
golang.org/x/net v0.37.0
26+
google.golang.org/api v0.226.0
27+
google.golang.org/protobuf v1.36.5
2828
)
2929

3030
require (
31-
cloud.google.com/go v0.38.0 // indirect
31+
cloud.google.com/go v0.112.2 // indirect
32+
cloud.google.com/go/auth v0.15.0 // indirect
33+
cloud.google.com/go/auth/oauth2adapt v0.2.7 // indirect
34+
cloud.google.com/go/compute/metadata v0.6.0 // indirect
35+
cloud.google.com/go/iam v1.1.6 // indirect
36+
cloud.google.com/go/storage v1.39.1 // indirect
3237
github.com/RoaringBitmap/roaring v1.9.3 // indirect
3338
github.com/bits-and-blooms/bitset v1.12.0 // indirect
3439
github.com/blevesearch/bleve_index_api v1.1.12 // indirect
@@ -49,25 +54,41 @@ require (
4954
github.com/blevesearch/zapx/v15 v15.3.16 // indirect
5055
github.com/blevesearch/zapx/v16 v16.1.9-0.20241217210638-a0519e7caf3b // indirect
5156
github.com/davecgh/go-spew v1.1.1 // indirect
57+
github.com/felixge/httpsnoop v1.0.4 // indirect
58+
github.com/go-logr/logr v1.4.2 // indirect
59+
github.com/go-logr/stdr v1.2.2 // indirect
5260
github.com/golang/geo v0.0.0-20210211234256-740aa86cb551 // indirect
61+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
5362
github.com/golang/protobuf v1.5.4 // indirect
54-
github.com/golang/snappy v0.0.1 // indirect
55-
github.com/google/uuid v1.0.0 // indirect
56-
github.com/googleapis/gax-go/v2 v2.0.5 // indirect
63+
github.com/golang/snappy v0.0.4 // indirect
64+
github.com/google/s2a-go v0.1.9 // indirect
65+
github.com/google/uuid v1.6.0 // indirect
66+
github.com/googleapis/enterprise-certificate-proxy v0.3.5 // indirect
67+
github.com/googleapis/gax-go/v2 v2.14.1 // indirect
5768
github.com/hashicorp/go-immutable-radix v1.1.0 // indirect
5869
github.com/hashicorp/golang-lru v0.5.1 // indirect
5970
github.com/json-iterator/go v0.0.0-20171115153421-f7279a603ede // indirect
6071
github.com/mschoch/smat v0.2.0 // indirect
6172
github.com/pmezard/go-difflib v1.0.0 // indirect
6273
go.etcd.io/bbolt v1.3.7 // indirect
63-
go.mongodb.org/mongo-driver v1.7.2 // indirect
64-
go.opencensus.io v0.21.0 // indirect
65-
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 // indirect
66-
golang.org/x/sys v0.13.0 // indirect
67-
golang.org/x/text v0.8.0 // indirect
68-
google.golang.org/appengine v1.5.0 // indirect
69-
google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873 // indirect
70-
google.golang.org/grpc v1.20.1 // indirect
74+
go.opencensus.io v0.24.0 // indirect
75+
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
76+
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0 // indirect
77+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 // indirect
78+
go.opentelemetry.io/otel v1.34.0 // indirect
79+
go.opentelemetry.io/otel/metric v1.34.0 // indirect
80+
go.opentelemetry.io/otel/trace v1.34.0 // indirect
81+
golang.org/x/crypto v0.36.0 // indirect
82+
golang.org/x/oauth2 v0.28.0 // indirect
83+
golang.org/x/sync v0.12.0 // indirect
84+
golang.org/x/sys v0.31.0 // indirect
85+
golang.org/x/text v0.23.0 // indirect
86+
golang.org/x/time v0.11.0 // indirect
87+
google.golang.org/appengine v1.6.8 // indirect
88+
google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect
89+
google.golang.org/genproto/googleapis/api v0.0.0-20250106144421-5f5ef82da422 // indirect
90+
google.golang.org/genproto/googleapis/rpc v0.0.0-20250303144028-a0af3efb3deb // indirect
91+
google.golang.org/grpc v1.71.0 // indirect
7192
gopkg.in/yaml.v3 v3.0.1 // indirect
7293
)
7394

0 commit comments

Comments
 (0)