Closed Seanny123 closed 3 years ago
Upon further investigation, this error seems to occur upstream with mindsdb_sql.parse_sql
which converts:
SELECT * FROM df WHERE seq-len > 7
Into:
SELECT * FROM df WHERE seq - len > 7
Thus I've opened an issue in the upstream project https://github.com/mindsdb/mindsdb_sql/issues/4
@Seanny123 Thank you, I will investigate shortly!
Indeed, the current regex for identifiers (columns, tables, etc) does not allow dashes
@Seanny123 I have investigated the issue. SQL standard does not allow identifiers with dashes to avoid ambiguity (e.g. postgres docs). However you can eclose identifiers in `
brackets:
SELECT * FROM df WHERE `seq-len` > 7
This will work. You can even add spaces and other symbols inside and it will still be a valid identifier
Given seq.csv:
The code:
Fails with the error:
If the column is renamed
seq-len
->seqlen
and the query is adjusted accordingly, then no error occurs.