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

tab delimiter not working #31

Closed
kousikan opened this issue Jun 9, 2014 · 4 comments
Closed

tab delimiter not working #31

kousikan opened this issue Jun 9, 2014 · 4 comments

Comments

@kousikan
Copy link

kousikan commented Jun 9, 2014

I tried to query a tab separated value using Textql, but unfortunately got an error.

[kveeramuthu@trinityqa1-235347 bin]$ cat ~/sample_data.tsv
id name value
1 kousi 10
2 umesh 20
3 don 30

[kveeramuthu@trinityqa1-235347 bin]$ ./textql -source ~/sample_data.tsv -header -dlm=tab -sql "select sum(value) from tbl" -verbose=true
Column 696420206e616d652020202076616c7565 renamed to id__name____value
Data loaded in: 174.98us
2014/06/09 18:48:38 no such column: value

[kveeramuthu@trinityqa1-235347 bin]$ ./textql -source ~/sample_data.tsv -header -dlm=tab -sql "select * from tbl" -verbose=true
Column 696420206e616d652020202076616c7565 renamed to id__name____value
Data loaded in: 178.048us
1 kousi 10
2 umesh 20
3 don 30
Queries run in: 143.194us

I was able to successfully run a query on the ';' separated values. Just TSV is not working.

[kveeramuthu@trinityqa1-235347 bin]$ cat ~/sample_data.txt
id;name;value
1;kousi;10
2;umesh;20
3;don;30
[kveeramuthu@trinityqa1-235347 bin]$

[kveeramuthu@trinityqa1-235347 bin]$ ./textql -source ~/sample_data.txt -header -dlm=';' -sql "select * from tbl" -verbose=true
Data loaded in: 196.183us
1, kousi, 10
2, umesh, 20
3, don, 30
Queries run in: 186.977us

[kveeramuthu@trinityqa1-235347 bin]$ ./textql -source ~/sample_data.txt -header -dlm=';' -sql "select max(id), max(name) from tbl" -verbose=true
Data loaded in: 176.664us
3, umesh
Queries run in: 140.822us

@dinedal
Copy link
Owner

dinedal commented Jun 9, 2014

Interesting I use textql with tab all the time

Does -dlm=0x09 work on your file?

@kousikan
Copy link
Author

kousikan commented Jun 9, 2014

The problem was with the input file. I had to use a different editor to put the tab characters properly. It is working fine now.

[kveeramuthu@trinityqa1-235347 ~]$ textql -source ~/sample_data.tsv -header -dlm=tab -sql "select * from tbl" -verbose=true
Data loaded in: 190.242us
1, kousi, 10
2, umesh, 20
3, don, 30
Queries run in: 247.045us
[kveeramuthu@trinityqa1-235347 ~]$ textql -source ~/sample_data.tsv -header -dlm=0x09 -sql "select sum(value),sum(id),max(name) from tbl" -verbose=true
Data loaded in: 100.992us
60, 6, umesh
Queries run in: 112.564us
[kveeramuthu@trinityqa1-235347 ~]$

@kousikan kousikan closed this as completed Jun 9, 2014
@dinedal
Copy link
Owner

dinedal commented Jun 9, 2014

Glad you were able to figure it out!

In the future, remember you can use whatever character you want for the delimiter, if you want, as long as you know the hex code.

@kousikan
Copy link
Author

kousikan commented Jun 9, 2014

Awesome. Thanks.
BTW, love this tool.

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

2 participants