diff --git a/sio/arrowio/writer.go b/sio/arrowio/writer.go index a2376134d..96db758f2 100644 --- a/sio/arrowio/writer.go +++ b/sio/arrowio/writer.go @@ -531,6 +531,7 @@ func isRecursive(typ super.Type, seen map[string]struct{}) bool { return true } seen[typ.Name] = struct{}{} + defer delete(seen, typ.Name) return isRecursive(typ.Type, seen) case *super.TypeRecord: for _, f := range typ.Fields { diff --git a/sio/arrowio/ztests/roundtrip.yaml b/sio/arrowio/ztests/roundtrip.yaml index fa2c09091..473a6d737 100644 --- a/sio/arrowio/ztests/roundtrip.yaml +++ b/sio/arrowio/ztests/roundtrip.yaml @@ -117,3 +117,19 @@ inputs: outputs: - name: stdout data: *stdin + +--- + +script: | + super -f arrows - | super -i arrows -s - + +inputs: + - name: stdin + data: | + type named = int64 + {a:1::named,b:2::named} + +outputs: + - name: stdout + data: | + {a:1,b:2} diff --git a/sio/arrowio/ztests/writer-errors.yaml b/sio/arrowio/ztests/writer-errors.yaml index 8cfab586e..9d1739ae6 100644 --- a/sio/arrowio/ztests/writer-errors.yaml +++ b/sio/arrowio/ztests/writer-errors.yaml @@ -1,7 +1,10 @@ script: | + ! echo '{a:1} {b:2}' | super -f arrows - ! echo 1 | super -f arrows - ! echo {} | super -f arrows - + ! echo 'type T={a:T|int64} {a:1}::T' | super -f arrows - + outputs: - name: stderr @@ -9,3 +12,4 @@ outputs: arrowio: encountered multiple types (consider 'fuse'): {a:int64} and {b:int64} arrowio: not a record: 1 arrowio: unsupported type: empty record + arrowio: unsupported type: T diff --git a/sio/parquetio/ztests/types.yaml b/sio/parquetio/ztests/types.yaml index ac642fb85..abb7c5da6 100644 --- a/sio/parquetio/ztests/types.yaml +++ b/sio/parquetio/ztests/types.yaml @@ -73,3 +73,21 @@ outputs: 2: null } } + + +--- + +script: | + super -f parquet -o f.parquet - + super -s f.parquet + +inputs: + - name: stdin + data: | + type named = int64 + {a:1::named,b:2::named} + +outputs: + - name: stdout + data: | + {a:1,b:2} diff --git a/sio/parquetio/ztests/writer-errors.yaml b/sio/parquetio/ztests/writer-errors.yaml index 508046033..9763b840d 100644 --- a/sio/parquetio/ztests/writer-errors.yaml +++ b/sio/parquetio/ztests/writer-errors.yaml @@ -2,12 +2,15 @@ script: | ! echo '{a:1} {b:2}' | super -f parquet - ! echo 1 | super -f parquet - ! echo {} | super -f parquet - + ! echo 'type T={a:T|int64} {a:1}::T' | super -f parquet - ! echo {a:1s} | super -f parquet - + outputs: - name: stderr data: | parquetio: encountered multiple types (consider 'fuse'): {a:int64} and {b:int64} parquetio: not a record: 1 parquetio: unsupported type: empty record + parquetio: unsupported type: T parquetio: unsupported type: not implemented: support for DURATION