eBay / tsv-utils

eBay's TSV Utilities: Command line tools for large, tabular data files. Filtering, statistics, sampling, joins and more.
https://ebay.github.io/tsv-utils/
Boost Software License 1.0
1.43k stars 80 forks source link

Experimental named field support in tsv-join #288

Closed jondegenhardt closed 4 years ago

jondegenhardt commented 4 years ago

This PR is a follow-on to PRs #284, #285, and #286. It adds named field support to tsv-join. It works the same way as the support added to tsv-select, see PR #284 for more info.

Named field support is backward compatible with numeric fields. As with other tools, this support is not documented yet, even in the help text. Documentation will be added when named field support has been added to all tools and a release performed.

One notable behavior of named field support in tsv-join is that the --k|key-fields option applies to two different files, the "filter file" and the "data files". When a numeric field is specified, it refers the same field number in each file. However, when it's a named field, the columns may have different field numbers in each file. Previously, if the join key was in different columns, the distinction required using both the --k|key-fields and --d|data-fields options. Now only the --k|key-fields option is needed if the join keys has the same field names in both files.

This is a step towards enhancement request #25.

codecov-commenter commented 4 years ago

Codecov Report

Merging #288 into master will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #288   +/-   ##
=======================================
  Coverage   99.32%   99.33%           
=======================================
  Files          18       18           
  Lines        6556     6575   +19     
=======================================
+ Hits         6512     6531   +19     
  Misses         44       44           
Impacted Files Coverage Δ
common/src/tsv_utils/common/fieldlist.d 99.87% <100.00%> (ø)
tsv-join/src/tsv_utils/tsv-join.d 100.00% <100.00%> (ø)