LOAD DATA INFILE and streaming CSV importer
Fixture people.csv contains: 3,Mo,71.25 and 4,Bo,65.00 on separate lines. Course imports are promised valid; validation may be skipped, but supporting indexes must still be built.
Contract
| Field | Value |
|---|---|
| Specification | IMPORT-001 |
| Module | sql |
| Scope | Required implementation or delivery |
| Milestone | M2, due 2026-12-20 |
| Owner role | Shared — choose one MR owner |
| Implementation | Planned; scaffold only |
| Contract review | Team review required before implementation |
Interface
Importer.load(database, table, path) -> rows
These are proposed C++ design contracts, not an already implemented API. Shared types and ownership define the intended module boundaries.
Dependencies
Acceptance checklist
- [ ] Parse simplified comma-delimited course data in bounded memory
- [ ] Load all eight TPC-H tables with correct types and maintain/build indexes
- [ ] Use one importer shared by SQL and CLI; emit the exact imported count
Setup data
Run this in a fresh isolated data directory before the example. Setup commands emit their own results; the expected block below covers only the listed input.
CREATE DATABASE demo;
USE demo;
CREATE TABLE people (id INT NOT NULL, name VARCHAR(16) NOT NULL, score FLOAT NOT NULL);
INSERT INTO people VALUES (1, 'Ada', 90.5), (2, 'Lin', 80.0);
Input
LOAD DATA INFILE '/mnt/data/people.csv' INTO TABLE people FIELDS TERMINATED BY ',';
Expected output
rows
2
@
Where no ORDER BY appears, row order is not guaranteed. Error message text is illustrative; required diagnostic keywords and result framing are binding.
Rejections and state
- Missing input/table -> !ERROR; do not claim successful load
Verification
Completion rule
Link this spec and its GitLab issue in an MR into develop. Include relevant Linux evidence, obtain the other teammate’s review, merge, delete the feature branch, and close the issue. A page describes intended behavior; the GitLab issue and merged code determine completion.