dinedal / textql

Execute SQL against structured text like CSV or TSV
MIT License
9.07k stars 300 forks source link

unrecognized token: "[" #100

Closed bsilverm closed 4 years ago

bsilverm commented 6 years ago

Every now and then I get the following error when parsing my logs:

2018/07/13 13:26:10 unrecognized token: "["

I was able to find a sample line that always seems to generate the error. I've attached a file that contains a sample problem line with the header I'm using.

This is the command I use and the result:

textql -save-to "test/db/mydb.db" -header -dlm=0x7c -sql "count()" test/log 2018/07/13 13:35:33 unrecognized token: "["

repro.txt

Any ideas on where this error comes from? Thanks,

dinedal commented 6 years ago

Thank you for submitting a reproducible issue! I appreciate it.

I will investigate and fix this issue, it is probably a bug; sorry about that!

kaustubhmallik commented 6 years ago

@dinedal Hey, if you are not actively looking into it, I would like to work on it. I am relatively new to go and looking forward to do some contributions.

dinedal commented 6 years ago

Please do! I am busy with the day job sadly

billtsalamander commented 6 years ago

I'm getting the issue, though maybe a different bug with the same symptom. The strangest part is that it depends on the way I do the path. Steps to reproduce cat b.csv a, b, c 1, 2, 0

textql -header -sql " select q.* from b as q " ./ 2018/08/03 13:00:45 unrecognized token: "["

textql -header -sql " select q.* from b as q " b.csv 1,2,0

update: This is OSX El Capitan

bsilverm commented 6 years ago

Any leads on this one? Thanks!