From 007f592d54804185736f0ad01ac523a1a0da70c1 Mon Sep 17 00:00:00 2001 From: majiayu000 <1835304752@qq.com> Date: Fri, 2 Jan 2026 04:05:30 +0800 Subject: [PATCH] fix: add separator between tables in table output When table output contains records with different schemas, headers are now separated by a '---' line to clearly distinguish between different tables. Signed-off-by: majiayu000 <1835304752@qq.com> --- sio/tableio/writer.go | 1 + sio/tableio/ztests/multiple-types.yaml | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 sio/tableio/ztests/multiple-types.yaml diff --git a/sio/tableio/writer.go b/sio/tableio/writer.go index d3866acab8..86b7440efa 100644 --- a/sio/tableio/writer.go +++ b/sio/tableio/writer.go @@ -43,6 +43,7 @@ func (w *Writer) Write(r super.Value) error { if r.Type() != w.typ { if w.typ != nil { w.flush() + w.writer.Write([]byte("---\n")) w.nline = 0 } // First time, or new descriptor, print header diff --git a/sio/tableio/ztests/multiple-types.yaml b/sio/tableio/ztests/multiple-types.yaml new file mode 100644 index 0000000000..a8b1997f09 --- /dev/null +++ b/sio/tableio/ztests/multiple-types.yaml @@ -0,0 +1,14 @@ +spq: pass + +input: | + {s:"foo",val:1} + {s:"bar"} + +output-flags: -f table + +output: | + s val + foo 1 + --- + s + bar