Skip to content

Dropping "text" and "table" output formats #6402

@philrz

Description

@philrz

Because of their multiple problems, we've reached consensus that the the text and table output formats should be dropped. However, as users have been known to reach for these features, it would be ideal to cover some functional gaps in alternate formats to allow for creating equivalent/better output (#5961, #6381).

Details

At the time this issue is being opened, super is at commit a3f7d15.

Some specific shortcomings of text and table outputs are described in #4023 and #4595. Because of these problems, we initially gave much more coverage in docs/examples to other output formats we believed were superior. However some users apparently were seeking the simpler functionality implied by their names, as several discovered them via help text, experienced their glitches, then came to community Slack asking for help/fixes. This led to my attempt to document their uses/limitations via docs so I'd have somewhere to point users each time this topic came up, and these are still visible in the old Zed docs here. But since they're still difficult to use even when aware of those limitations and their flaws were seen as difficult to fix, they've been dropped again from the most recent docs and so we've decided to drop them from the tools as well.

Thankfully, we do have alternate formats that cover most of what these formats could do. Specifically:

  1. line mode is useful for printing values without formatting, e.g., strings without quotes, similar to text. One limitation of line mode is that records are printed in SUP format whereas line would print just values, but combining line mode with f-strings can achieve this. We've also considered adding sprintf-like functionality (sprintf-like function #3147) to provide more options here.

    $ super -version
    Version: a3f7d1558
    
    $ echo '{foo: "bar"}' | super -f text -
    bar
    
    $ echo '{foo: "bar"}' | super -f line -
    {foo:"bar"}
    
    $ echo '{foo: "bar"}' | super -f line -c 'f"{foo}"' -
    bar
    
  2. csv or tsv modes offer a columnar output similar in nature to table, with the advantage that they steer users toward fuse to avoid the problem described in Repeated headers can make table output confusing #4023.

That said, speaking as one user, I've come to rely on text mode specifically in some contexts and a couple functional gaps prevent me from switching seamlessly to one of these other formats. My specific use case happens to relate to the sqllogictests that ultimately get run nightly in the sqllogic-ztests repo. The expected outputs of these tests are basically TSV, but I'd been relying on SuperDB's text mode to create query outputs for diff-ing against the sqllogictest outputs, specifically for two reasons.

  1. SuperDB's tsv mode currently always prints a header of column names, but the sqllogictest outputs never have a header. Being able to print CSV/TSV without a header is a common config knob in other tools, so it's proposed we offer the same (Writing CSV/TSV files with no header #6381).

  2. SuperDB's tsv and csv currently print null values and empty strings the same (Differentiating null value and empty string in CSV output #5868), but sqllogictests output lots of NULL values so being able to render these accurately is important. Meanwhile, with text mode, null values were printed as -, which was adequate. Like in other tools, it's proposed we offer an option for a user to specify how null values are printed in TSV/CSV output (User config knob for NULL presentation #5961).

Speaking once again just for my own usage, I'm currently applying a hacky patch to the super binary whenever running sqllogictests in order to cover these gaps, and it's getting me by ok. However, to avoid showing hacks in our public-facing tests and also to have something to offer other existing users that may have come to rely on these formats, it would be great if we could provide these knobs at the same time we drop the text and table formats.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions