1. Alister Cordiner
  2. csvquerytool
  3. Issues
Issue #5 new

Illegal seek exception when piping a large file to stdin

Alister Cordiner
repo owner created an issue

Steps to reproduce:

(ve)foobar@foobar:~$ (echo "row_id" && for n in {1..500000}; do echo "$n"; done) > /tmp/table.csv
(ve)foobar@foobar:~$ csvquery -q "SELECT MAX(row_id) FROM csv" <(cat /tmp/table.csv)
Traceback (most recent call last):
  File "/home/foobar/ve/bin/csvquery", line 25, in <module>
    csvquerytool.run_query(options.query, csv_files)
  File "/home/foobar/ve/local/lib/python2.7/site-packages/csvquerytool/__init__.py", line 143, in run_query
    create_table(csv_file, db_cur, 'csv%d' % (n + 1) if n > 0 else 'csv')
  File "/home/foobar/ve/local/lib/python2.7/site-packages/csvquerytool/__init__.py", line 121, in create_table
    _logger.info("loaded %.2f%% of csv file", 100.0 * csv_fh.tell() / file_size)
IOError: [Errno 29] Illegal seek

Comments (0)

  1. Log in to comment