Skip to content

Commit

Permalink
Allow org.apache names in Connect JSON schema
Browse files Browse the repository at this point in the history
connectjson.Decoder deliberately panics if it encounters a schema
element whose name begins with org.apache.  Remove that behavior so
org.apache names are allowed.

(The panic is left over from development of the connectjson package,
when it wasn't clear whether to interpret values according to schema
element names during decoding.  For example, a value whose corresponding
schema element has type int64 and name
org.apache.kafka.connect.data.Timestamp could be interpreted either as a
simple int64 or, per the name, as a time in milliseconds since the Unix
epoch.  The connectjson package takes the former approach, mostly
because the current decoding process offers no easy way to perform the
necessary scaling.)
  • Loading branch information
nwt committed Mar 14, 2024
1 parent ad5baae commit 78cd75c
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions connectjson/connectjson.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"encoding/json"
"errors"
"fmt"
"strings"

"github.com/brimdata/zed"
"github.com/brimdata/zed/runtime/sam/expr"
Expand Down Expand Up @@ -229,9 +228,6 @@ func (c *Decoder) Decode(b []byte) (zed.Value, error) {
}

func (c *Decoder) decodeSchema(s *connectSchema) (string, zed.Type, error) {
if strings.HasPrefix(s.Name, "org.apache") {
panic("XXX " + s.Name)
}
var typ zed.Type
var err error
switch s.Type {
Expand Down

0 comments on commit 78cd75c

Please sign in to comment.