justforfunc
justforfunc copied to clipboard
40-csvql: Setting column Source to be the table name
Just a small issue.
With the code in the video, if you try and apply a projection to a query, you get this error
mysql> select name from cities;
ERROR 1105 (HY000): unknown error: table "cities" does not have column "name"
This is because the Source attribute in the Column was being set as the path of the CSV file, rather than the table name.
This PR fixes issue #93
mysql> select name, country from cities where country <> 'USA';
+-----------+---------+
| name | country |
+-----------+---------+
| Barcelona | Spain |
| Paris | France |
| Shanghai | China |
+-----------+---------+
3 rows in set (0.00 sec)