Skip to content

Commit 1486af7

Browse files
authored
Allow org.apache names in Connect JSON schema (#123)
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.)
1 parent ad5baae commit 1486af7

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

connectjson/connectjson.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"encoding/json"
1010
"errors"
1111
"fmt"
12-
"strings"
1312

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

231230
func (c *Decoder) decodeSchema(s *connectSchema) (string, zed.Type, error) {
232-
if strings.HasPrefix(s.Name, "org.apache") {
233-
panic("XXX " + s.Name)
234-
}
235231
var typ zed.Type
236232
var err error
237233
switch s.Type {

0 commit comments

Comments
 (0)