Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fieldlists: Refactor command line arg processing, part 1 #293

Merged

Conversation

jondegenhardt
Copy link
Contributor

This PR is a follow-on to the named field PR series start with PR #284.

This PR addresses one of the main issues with using named fields - The header line must be read before command line arguments using field names can processed. If the tool is in the later stage of a unix command pipeline, it might be a while before the tool receives data and reads the header line. An error in the command line arguments will terminate the operation. If the data is large, this could occur a decent period after starting the operation.

This PR addresses this in a couple of ways. First, command line arguments not needing access to the header line are processed first, prior to reading the header. Errors for invalid command line arguments are output immediately. If header lines are not being processed (no --H|headers), then this includes field lists, as they must be numeric. Second, header lines are output immediately, prior to processing other input. This has the effect of passing header lines down the Unix command pipeline. Command line argument handling can occur much earlier, without a lengthy time delay.

This PR implements this for: tsv-select, tsv-filter, tsv-sample, and tsv-join. Other tools will be updated in a subsequent PR.

This is a step towards enhancement request #25.

@jondegenhardt jondegenhardt merged commit caed640 into eBay:master Jun 16, 2020
@jondegenhardt jondegenhardt deleted the fieldlist-refactor-cmdarg-processing branch June 16, 2020 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant