fix: partition add proper stdin handling regression introduced when --limit option was added
#3161
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.
resolves #3160
This stdin handling bug was inadvertently introduced when the
--limitoption was added to allow partitioning using columns with very high cardinality which opened thousands of file handles that overran the OS limit.This was "fixed" by partitioning in batches below the operating system limit. This however, required, reading the input file several times which doesn't work with stdin as its consumed once its read for the first time, causing the stdin regression.
Fixed by writing stdin to a tempfile.