Skip to content

Commit

Permalink
Merge pull request #3154 from redpanda-data/avro
Browse files Browse the repository at this point in the history
avro: upgrade hamba library
  • Loading branch information
rockwotj authored Jan 29, 2025
2 parents 8638c31 + 8a062a1 commit 83ad4d1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ require (
github.com/golang-jwt/jwt/v5 v5.2.1
github.com/googleapis/go-sql-spanner v1.8.0
github.com/gosimple/slug v1.14.0
github.com/hamba/avro/v2 v2.22.2-0.20240625062549-66aad10411d9
github.com/hamba/avro/v2 v2.27.0
github.com/influxdata/influxdb1-client v0.0.0-20220302092344-a9ab5670611c
github.com/jackc/pgx/v4 v4.18.3
github.com/jackc/pgx/v5 v5.6.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1319,8 +1319,8 @@ github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 h1:asbCHRVmodnJTuQ3qamDwqVOIjw
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0/go.mod h1:ggCgvZ2r7uOoQjOyu2Y1NhHmEPPzzuhWgcza5M1Ji1I=
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed h1:5upAirOpQc1Q53c0bnx2ufif5kANL7bfZWcc6VJWJd8=
github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4=
github.com/hamba/avro/v2 v2.22.2-0.20240625062549-66aad10411d9 h1:NEoabXt33PDWK4fXryK4e+XX+fSKDmmu9vg3yb9YI2M=
github.com/hamba/avro/v2 v2.22.2-0.20240625062549-66aad10411d9/go.mod h1:fQVdB2mFZBhPW1D5Abej41LMvrErARGrrdjOnKbm5yw=
github.com/hamba/avro/v2 v2.27.0 h1:IAM4lQ0VzUIKBuo4qlAiLKfqALSrFC+zi1iseTtbBKU=
github.com/hamba/avro/v2 v2.27.0/go.mod h1:jN209lopfllfrz7IGoZErlDz+AyUJ3vrBePQFZwYf5I=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
Expand Down
7 changes: 4 additions & 3 deletions internal/impl/confluent/serde_hamba_avro.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ func (s *schemaRegistryDecoder) getHambaAvroDecoder(ctx context.Context, schema
if err != nil {
return fmt.Errorf("unable to extract bytes from message: %w", err)
}
var native any
if err := avro.Unmarshal(codec, b, &native); err != nil {
return fmt.Errorf("unable to unmarshal avro: %w", err)
r := avro.NewReader(nil, 0).Reset(b)
native := r.ReadNext(codec)
if r.Error != nil {
return fmt.Errorf("unable to unmarshal avro: %w", r.Error)
}
var w avroSchemaWalker
w.unnestUnions = s.cfg.avro.rawUnions
Expand Down

0 comments on commit 83ad4d1

Please sign in to comment.