# Playground Import

## Start Playground

Default validation target:

- customer-local environment
- `tiup playground nightly`

Only use a previously provided remote host when the user explicitly asks for that.

Minimal recommended shape:

```bash
tiup playground nightly \
  --db 1 \
  --pd 1 \
  --kv 1 \
  --tiflash 0 \
  --without-monitor \
  --tag <tag>
```

TiDB is typically reachable at:

```bash
mysql --comments --host 127.0.0.1 --port 4000 -u root
```

Wait until a simple `select version();` succeeds before creating tables.

If the user asks for a pinned version instead of nightly, follow the user's version.

## Schema Application

Prefer the user-provided schema over generated dbgen schema.

If the schema document has multiple `CREATE TABLE` blocks with missing separators, normalize a copy before applying it.

## IMPORT INTO Pattern

For CSVs with headers:

```sql
IMPORT INTO db.table (col1, col2, ...)
FROM '/absolute/path/to/file.csv'
WITH skip_rows=1;
```

For simple one-file imports, use a server-local absolute path.

## Job Inspection

Useful checks:

```sql
SHOW IMPORT JOBS;
SHOW PROCESSLIST;
```

## Post-import Verification

Always run:

- row counts
- one representative join query
- one representative filter or window query

If the workload is join-heavy, verify imported results with the same logical join keys used in the source SQL.

## Suggested Output

After import, summarize:

- table counts
- sample joined rows
- whether representative predicates matched as expected
- any schema or import workaround that was needed
