herrfugbaum / qsv

Process CSV and TSV files with SQL.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Errors executing even the first "SELECT" statement

ankush981 opened this issue · comments

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.

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.

Ah. Cool, thanks!