blaze / blaze/odo

Importing CSV to sqlite3 fails due to invalid command-line syntax

Open
#482 5 comments 0 reactions 0 assignees View on GitHub
bug sql
Dominant language
Python
Stars
1k
Forks
131
PR merge metrics
No merged PRs in 30d

Description

When importing a CSV odo invokes sqlite3 with command-line arguments: `sqlite3 -nullvalue '' -separator , -cmd '.import "/path/to/csv/file" tablename' /path/to/db/file`

However, current sqlite3 (version 3.6.20) does not support a `-cmd` option. Instead, the invocation should look like this: `sqlite3 -nullvalue '' -separator , /path/to/db/file '.import "/path/to/csv/file" tablename'`

I patched odo/backends/sql_csv.py:compile_from_csv_sqlite() accordingly and it works like a charm. Happy to submit the patch if that'll speed things up. Please advise, thanks!

Contributor guide

No contributing guide indexed for this repository

Research direction

Open odo/backends/sql_csv.py and inspect compile_from_csv_sqlite(). Compare the generated sqlite3 invocation with the command shown in the issue, then exercise the CSV-to-SQLite import using sqlite3 version 3.6.20. Done means a CSV imports successfully without the unsupported -cmd option.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, sqlite
Domain
databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.