Modify the cut/coalesce example in Zed language docs #4776
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These are additional changes beyond the ones first merged in #4773 (thanks @iloveitaly!).
Traditionally, the docs have taken an approach of trying to show language components mostly in isolation using small examples. The hope is that the user will see them as building blocks such that they'll combine them with other components in useful ways. To the degree that there's specific combinations that enable powerful use cases, we've tried to reveal these through the tutorials, CLI command walk-throughs, and so forth.
Meanwhile, the docs improvements in #4773 were from a community user that had started from a use case that:
cut
operator)coalesce()
function to create that single record type.)It turns out there's other ways to address the limitation (e.g., using the
fuse
operator, or specifying thenull
value asint64
type in the input data) and there's other other use cases that would benefit from this same treatment (e.g., outputting heterogenous records withoutcut
, or output in Parquet format). Therefore the original text might benefit from some tweaks.Here I've tried to make the example a little more widely applicable by noting:
fuse
is yet another available approachI also used some of the Docusaurus formatting to present the use case context differently.