cockroachdb / cockroachdb/cockroach

importer: handle IMPORT options at parse time with uniqueness checks

Open
#173,622 0 comments 0 reactions 0 assignees View on GitHub
C-enhancement O-agent T-sql-foundations
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

**Summary:**
IMPORT options are evaluated into a `map[string]string` via
`exprutil.Evaluator.KVOptions`, so a duplicated option is silently last-value-wins
with no parse-time uniqueness check — unlike BACKUP/RESTORE, which handle options
at parse time and error on duplicates. Migrate IMPORT to the same parse-time model.

**Background:**
The `execution_locality` option is a generic KVOption (chosen for uniformity with
the other IMPORT options). The tradeoff is that it — and every other IMPORT option
— is last-value-wins on duplicates. This tracks moving all IMPORT options to
parse-time handling for uniform uniqueness detection.

**Proposed work:**
- [ ] Handle IMPORT options at parse time (grammar or a parse-time combiner),
matching BACKUP/RESTORE.
- [ ] Restore duplicate-detection for `execution_locality` and add it for the
other options.

Epic CRDB-65504

Jira issue: CRDB-66933

Contributor guide

Open the contributing guide

Research direction

Compare IMPORT option handling with the parse-time path used by BACKUP/RESTORE, then inspect exprutil.Evaluator.KVOptions. Done means IMPORT options are handled at parse time and duplicate execution_locality and other options are rejected rather than silently using the last value.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.