xsv
xsv copied to clipboard
Feature request: A new join type `--left-anti`
I would suggest to add a new join type left-anti
which has same semantic as what Spark does. Basically this join type will return the left table when the key is not found in the right table.
Here is an example:
Suppose we have a.csv
name,quantity
apple,10
orange,50
and b.csv
name,color
apple,10
After running this proposed command: xsv join name a.csv name b.csv --left-anti
, it will output
name,quantity
orange,50
Because orange
is not found in b.csv
. Please also note that the output will have a.csv
columns only.
I know this is same as the following combination, but it would be great it this feature is built in the xsv
.
xsv join name a.csv name b.csv --left \
| xsv search -s 'name[1]' '^$' \
| xsv select 'name,quantity'
Any thoughts?
I think this would be a nice feature. I have a use case for this