herrfugbaum / qsv

Process CSV and TSV files with SQL.
MIT License
13 stars 5 forks source link

Errors executing even the first "SELECT" statement #13

Closed ankush981 closed 5 years ago

ankush981 commented 5 years ago

So I ran the tool against the StackOverflow Survey Results CSV (28 MB file) that looks like this:

data

And then when I try to run qsv I get the following errors:

qsv$ node bin/qsv.js -p "/home/ankush/Desktop/data.csv" -h
QSV> select * from table;
Lexing Errors detected.
unexpected character: ->;<- at offset: 19, skipped 1 characters.
QSV> Select * from table;
Lexing Errors detected.
unexpected character: ->;<- at offset: 19, skipped 1 characters.
QSV> SELECT * from table;
Lexing Errors detected.
unexpected character: ->;<- at offset: 19, skipped 1 characters.
QSV> SELECT * from Table
Parsing errors detected!
Expecting token of type --> From <-- but found --> 'from' <--
QSV> SELECT * from table
Parsing errors detected!
Expecting token of type --> From <-- but found --> 'from' <--
QSV> qsv$ node bin/qsv.js -p "/home/ankush/Desktop/data.csv" -h
QSV> select * from table;
Lexing Errors detected.
unexpected character: ->;<- at offset: 19, skipped 1 characters.

I'm at a loss to understand why even the basic "SELECT" statement is not being accepted. I've tried several variations, as evident in the snippet, but something seems to be stuck somewhere.

How to resolve this? Happy to provide more info if needed.

herrfugbaum commented 5 years ago

This happens because the parser doesn't understand much yet.

To make it work try:

SELECT * FROM table

Note: All keywords are uppercase and no semicolon.

ankush981 commented 5 years ago

Ah. Cool, thanks!