Open yizzlez opened 1 year ago
MarshalFast cannot handle doubly nested types. The below test fails:
MarshalFast
func TestMarshalFastWithDoubleNestedType(t *testing.T) { type Tag struct { Key string `parquet:"name=key, type=BYTE_ARRAY"` } type Span struct { Tags []Tag `parquet:"name=tags, type=LIST"` } type Trace struct { Spans []Span `parquet:"name=spans, type=LIST"` } span1 := Span{ Tags: []Tag{ {"foo"}, {"bar"}, }, } span2 := Span{ Tags: []Tag{ {"baz"}, }, } traces := []interface{}{ Trace{ Spans: []Span{span1, span2}, }, } sch, err := schema.NewSchemaHandlerFromStruct(new(Trace)) if err != nil { t.Fatalf("%v", err) } expected, err := marshal.Marshal(traces, sch) actual, err := MarshalFast(traces, sch) if !reflect.DeepEqual(expected, actual) { t.Errorf("not equal") } }
hi, do single nested type work?
MarshalFast
cannot handle doubly nested types. The below test fails: