| name | eddytor-data-import |
| description | Imports CSV data into Eddytor tables with schema inference, type mapping, and post-import validation. Activates for CSV import, data loading, schema preview, raw CSV content, type detection, or delimiter handling — even without the word "import."
|
| license | CC-BY-NC-4.0 |
| metadata | {"author":"eddytor","version":"1.0"} |
Data Import
Default workflow: infer → import → constrain → validate
infer_schema with CSV content → review column types and domain candidates
import_csv with reviewed schema → creates table + inserts rows in one step
set_column_domain on domain candidates flagged by step 1
validate_domain_values + profile_table → confirm data quality
Always start with infer_schema. Skipping it means type surprises after import.
infer_schema — preview before committing
Returns row count, column names, Arrow types (with nullability), and domain candidates (low-cardinality string columns with distinct values listed). The delimiter is auto-detected internally for parsing but is not part of the response.
Review the output. Common adjustments:
- Dates as
Utf8 → should be Date32/Timestamp
- IDs as
Int64 → use Utf8 if they have leading zeros
- Boolean-like strings (
"yes"/"no") → set a fixed domain after import
import_csv — one-step table creation
{
"table_name": "products",
"location": "abfss://container@account.dfs.core.windows.net/master-data",
"primary_key_column": "product_id",
"csv_content": "product_id,name,category,price\nP001,Widget,Electronics,29.99\n...",
"non_nullable_columns": ["product_id", "name", "category"]
}
delimiter auto-detects , ; \t | — set explicitly only if auto-detection fails.
Post-import validation loop
profile_table → verify row count, check null distributions
validate_constraints → check expressions hold
validate_domain_values → catch typos in constrained columns
- If issues: fix with
merge_rows → re-validate
Gotchas
table_name is bare only (products), never prefixed with catalog/schema.
primary_key_column must be a column name that exists in the CSV.
- If import fails (type conflict, duplicate PKs), the table is not created — fix data and retry.
csv_content has MCP message size limits (~5MB). For larger files: create the table with a first batch, then use insert_rows for the rest.
- Empty strings in CSV are not the same as NULL — check nullability settings.
"001234" becomes 1234 if inferred as Int64 — ensure Utf8 type to preserve leading zeros.