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

Unintuitive no-headers join behaviour #254

Open
tomarrell opened this issue Dec 17, 2020 · 0 comments
Open

Unintuitive no-headers join behaviour #254

tomarrell opened this issue Dec 17, 2020 · 0 comments

Comments

@tomarrell
Copy link

Ran into some slightly unintuitive behaviour when misusing a join due to omission of the --no-headers flag.

When inputting two files, both without headers and trying to perform a join while forgetting the flag, the first result appears to be joined with a value that does not match. I've included a minimum reproducible example below.

input_1.csv

1,test1
2,test2
3,test3

input_2.csv

a,oops
b,test1
c,test2
d,test3

Running the command:

> xsv join 2 input_1.csv 2 input_2.csv
1,test1,a,oops
2,test2,c,test2
3,test3,d,test3

As you can see, the first row of the first input is joined with the first row of the second input – even though there is a valid join for the first row in the second input, on the second line.

This is slightly counter-intuitive behaviour even considering the omission of the --no-headers flag.

Intuitively, I would expect that even with omission of the flag, the following should be output.

1,test1,a,test1
2,test2,c,test2
3,test3,d,test3

Apologies if this comes across as a little nit picky, feel free to close it if there is a good reason not to have this behaviour that I'm missing.

Cheers!

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

No branches or pull requests

1 participant